If you want to show code copy and paste it in, highlight it and press the </> button. It’s so much easier to read. What page in the documentation did you get the code from?
Looking at the code it is suggesting that DesktopRadioButton doesn’t have a constructor that takes just one string. According to the Docs it does offer one, not sure why that wouldn’t work.
Var aButton As New DesktopRadioButton( "Hello", True )
Fails in the same way. Add a bug report against the documentation?
Web claims to have a similar constructor, perhaps they either thought of adding it and didn’t or copied the documentation from the web version and forgot to remove it?
me.RemoveAllRows
me.AddAt(0, new WebRadiobutton("Test1"))
me.AddAt(1, new WebRadiobutton("Test2"))
me.AddAt(2, new WebRadiobutton("Test3"))
me.AddAt(3, new WebRadiobutton("Test4"))
Note: RemoveAllRows instead of RemoveAll for Desktop
me.RemoveAll
Var rb As New DesktopRadioButton
Var rb1 As New DesktopRadioButton
Var rb2 As New DesktopRadioButton
Var rb3 As New DesktopRadioButton
rb.Caption = "Test1"
me.AddAt(0, rb)
rb1.Caption = "Test2"
me.AddAt(1, rb1)
rb2.Caption = "Test3"
me.AddAt(2, rb2)
rb3.Caption = "Test4"
me.AddAt(3, rb3)
I just replied and the site grabbed whatever. Okay, so I went and looked back and reply that seems to have everyone confused is actually not that mysterious. In Alberto’s response to me he posted both web and desktop. His web response was at the top and the desktop portion below. What worked was the desktop portion, but I replied to his post to acknowledge his desktop solution… see below, worked.
' ----> Variables <----
Var rBtn01 As New DesktopRadioButton
Var rBtn02 As New DesktopRadioButton
Var rBtn03 As New DesktopRadioButton
Var rBtn04 As New DesktopRadioButton
Var rBtn05 As New DesktopRadioButton
Var rBtn06 As New DesktopRadioButton
Var rBtn07 As New DesktopRadioButton
Var rBtn08 As New DesktopRadioButton
Var rBtn09 As New DesktopRadioButton
Var rBtn10 As New DesktopRadioButton
' ----> Preliminary Code <----
Me.RemoveAll
' ----> Main Code <----
Select Case frmMaster.cboDaily.Text
Case "Groceries"
rBtn01.Caption = "Dollar General"
Me.AddAt( 0, rBtn01 )
rBtn02.Caption = "Safeway"
Me.AddAt( 1, rBtn02 )
rBtn03.Caption = "SaveMart"
Me.AddAt( 2, rBtn03 )
rBtn04.Caption = "WalMart"
Me.AddAt( 3, rBtn04 )
Case "Dining Out"
rBtn01.Caption = "The Willow Wisp"
Me.AddAt( 0, rBtn01 )
rBtn02.Caption = "BeWok Japanese"
Me.AddAt( 1, rBtn02 )
rBtn03.Caption = "Pizza Plus"
Me.AddAt( 2, rBtn03 )
rBtn04.Caption = "Mongolian BBQ"
Me.AddAt( 3, rBtn04 )
rBtn05.Caption = "McDonald's"
Me.AddAt( 4, rBtn05 )
Case "Entertainment"
End Select
Me.SelectedIndex = -1
The web stuff, I never even tried it… because I don’t do web stuff.
So the confusion is that the quoting mechanism hid everything apart from the WebRadioButton elements, thus the confusion. I’ve only just noticed the arrow that allows you to see more.
Just a note. When quoting you can start a reply and then highlight part of a post and click the button that shows to quote just that part. It helps with clarity and makes things shorter. Both helpful.