T
Tammy Nejadian
Hi, Could someone please et me know how I can convert the below codes from
Visual Basic to C# using Visual studio. When each button clicked they create
list box and Radio Button. I want to convert those codes into C# doing same
action. The codes are:
Private Sub bAddListbox_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles bAddListbox.Click
Dim lb As New ListBox
lb.Height = 75
lb.Width = 70
lb.Items.Add("listbox")
tlp.Controls.Add(lb)
End Sub
Private Sub bRadiobutton_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles bRadiobutton.Click
Dim iNum As Int64
iNum = InputBox("Enter number of options", "Entry", 4)
Dim rbflp As New FlowLayoutPanel
rbflp.AutoSize = True
rbflp.AutoSizeMode = Windows.Forms.AutoSizeMode.GrowAndShrink
rbflp.FlowDirection = FlowDirection.LeftToRight
For i As Int16 = 1 To iNum
Dim rbl As New RadioButton
rbl.Text = "option " + CStr(i)
rbflp.Controls.Add(rbl)
Next
tlp.Controls.Add(rbflp)
End Sub
Visual Basic to C# using Visual studio. When each button clicked they create
list box and Radio Button. I want to convert those codes into C# doing same
action. The codes are:
Private Sub bAddListbox_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles bAddListbox.Click
Dim lb As New ListBox
lb.Height = 75
lb.Width = 70
lb.Items.Add("listbox")
tlp.Controls.Add(lb)
End Sub
Private Sub bRadiobutton_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles bRadiobutton.Click
Dim iNum As Int64
iNum = InputBox("Enter number of options", "Entry", 4)
Dim rbflp As New FlowLayoutPanel
rbflp.AutoSize = True
rbflp.AutoSizeMode = Windows.Forms.AutoSizeMode.GrowAndShrink
rbflp.FlowDirection = FlowDirection.LeftToRight
For i As Int16 = 1 To iNum
Dim rbl As New RadioButton
rbl.Text = "option " + CStr(i)
rbflp.Controls.Add(rbl)
Next
tlp.Controls.Add(rbflp)
End Sub