[COLOR=black][FONT=Courier New][COLOR=blue]Private[/COLOR] [COLOR=blue]Sub[/COLOR] makeRadioButtons([COLOR=blue]ByVal[/COLOR] location [COLOR=blue]As[/COLOR] Point, [COLOR=blue]ByVal[/COLOR] spacing [COLOR=blue]As[/COLOR] Int32, [COLOR=blue]ByVal[/COLOR] items [COLOR=blue]As[/COLOR] [COLOR=blue]String[/COLOR]())
[COLOR=blue]Dim[/COLOR] radioButton [COLOR=blue]As[/COLOR] RadioButton
[COLOR=blue]For[/COLOR] [COLOR=blue]Each[/COLOR] item [COLOR=blue]As[/COLOR] [COLOR=blue]String[/COLOR] [COLOR=blue]In[/COLOR] items
radioButton = [COLOR=blue]New[/COLOR] RadioButton
radioButton.Text = item
radioButton.Location = location
location.Y += radioButton.Height + spacing
Controls.Add(radioButton)
[COLOR=blue]Next[/COLOR]
[COLOR=blue]End[/COLOR] [COLOR=blue]Sub[/COLOR]
[/FONT][/COLOR]
[COLOR=black][FONT=Courier New]makeRadioButtons([COLOR=blue]New[/COLOR] Point(15, 10), 2, [COLOR=blue]New[/COLOR] [COLOR=blue]String[/COLOR]() {[COLOR=maroon]"One"[/COLOR], [COLOR=maroon]"Two"[/COLOR], [COLOR=maroon]"Three"[/COLOR], [COLOR=maroon]"Four"[/COLOR]})
[/FONT][/COLOR]
ToolTip1.SetToolTip(txtFullName, "Please enter your name here")
[COLOR=black][FONT=Courier New][COLOR=blue]Private[/COLOR] [COLOR=blue]Sub[/COLOR] makeRadioButtons([COLOR=blue]ByVal[/COLOR] location [COLOR=blue]As[/COLOR] Point, [COLOR=blue]ByVal[/COLOR] spacing [COLOR=blue]As[/COLOR] Int32, _
[COLOR=blue]ByVal[/COLOR] items [COLOR=blue]As[/COLOR] [COLOR=blue]String[/COLOR](,), [COLOR=blue]ByVal[/COLOR] toolTip [COLOR=blue]As[/COLOR] ToolTip)
[COLOR=blue]Dim[/COLOR] radioButton [COLOR=blue]As[/COLOR] RadioButton
[COLOR=blue]For[/COLOR] index [COLOR=blue]As[/COLOR] Int32 = 0 [COLOR=blue]To[/COLOR] items.GetUpperBound(1)
radioButton = [COLOR=blue]New[/COLOR] RadioButton
radioButton.Text = items(0, index)
toolTip.SetToolTip(radioButton, items(1, index))
radioButton.Location = location
location.Y += radioButton.Height + spacing
Controls.Add(radioButton)
[COLOR=blue]Next[/COLOR]
[COLOR=blue]End[/COLOR] [COLOR=blue]Sub[/COLOR]
[/FONT][/COLOR]
[COLOR=black][FONT=Courier New]makeRadioButtons([COLOR=blue]New[/COLOR] Point(15, 10), 2, [COLOR=blue]New[/COLOR] [COLOR=blue]String[/COLOR](,) _
{{[COLOR=maroon]"One"[/COLOR], [COLOR=maroon]"Two"[/COLOR], [COLOR=maroon]"Three"[/COLOR], [COLOR=maroon]"Four"[/COLOR]}, _
{[COLOR=maroon]"Tooltip One"[/COLOR], [COLOR=maroon]"Another ToolTip"[/COLOR], [COLOR=maroon]"Yet another ToolTip"[/COLOR], [COLOR=maroon]"Last ToolTip"[/COLOR]}}, _
ToolTip1)
[/FONT][/COLOR]
[COLOR=black][FONT=Courier New][COLOR=blue]Private[/COLOR] [COLOR=blue]Sub[/COLOR] radioClick([COLOR=blue]ByVal[/COLOR] sender [COLOR=blue]As[/COLOR] [COLOR=blue]Object[/COLOR], [COLOR=blue]ByVal[/COLOR] e [COLOR=blue]As[/COLOR] EventArgs)
Label1.Text = [COLOR=blue]DirectCast[/COLOR](sender, RadioButton).Text
[COLOR=blue]End[/COLOR] [COLOR=blue]Sub[/COLOR]
[COLOR=blue]Private[/COLOR] [COLOR=blue]Sub[/COLOR] makeRadioButtons([COLOR=blue]ByVal[/COLOR] location [COLOR=blue]As[/COLOR] Point, [COLOR=blue]ByVal[/COLOR] spacing [COLOR=blue]As[/COLOR] Int32, _
[COLOR=blue]ByVal[/COLOR] items [COLOR=blue]As[/COLOR] [COLOR=blue]String[/COLOR](,), [COLOR=blue]ByVal[/COLOR] toolTip [COLOR=blue]As[/COLOR] ToolTip)
[COLOR=blue]Dim[/COLOR] radioButton [COLOR=blue]As[/COLOR] RadioButton
[COLOR=blue]For[/COLOR] index [COLOR=blue]As[/COLOR] Int32 = 0 [COLOR=blue]To[/COLOR] items.GetUpperBound(1)
radioButton = [COLOR=blue]New[/COLOR] RadioButton
radioButton.Text = items(0, index)
toolTip.SetToolTip(radioButton, items(1, index))
radioButton.Location = location
location.Y += radioButton.Height + spacing
[SIZE=2][COLOR=#008000] ' add eventhandler
[/COLOR][/SIZE] [COLOR=blue]AddHandler[/COLOR] radioButton.Click, [COLOR=blue]AddressOf[/COLOR] radioClick
Controls.Add(radioButton)
[COLOR=blue]Next[/COLOR]
[COLOR=blue]End[/COLOR] [COLOR=blue]Sub[/COLOR]
[/FONT][/COLOR]