Friends, I want to convert a text to menu options
The menu should show the color that is in the text box separated by comma
example 1:
Dim colors As String = “Red”
PopupMenu Initial-value list
Red
example 2:
Dim colors As String = “Red, Green”
PopupMenu Initial-value list
Red
Green
Hey Victor,
One way would be to create an array of strings from your colors string using Split then Loop thru the Array to Add the Rows. Check out the Docs for Split and the example in PopupMenu. I modified the following from the example, but I haven’t tested it…
Dim monthString As String = "January, February"
Dim months() As String
months = Split( monthString, ", " )
For Each m As String In months
MyPopupMenu.AddRow(m)
Next
[quote=377995:@Hal Gumbert]Hey Victor,
One way would be to create an array of strings from your colors string using Split then Loop thru the Array to Add the Rows. Check out the Docs for Split and the example in PopupMenu. I modified the following from the example, but I haven’t tested it…
Dim monthString As String = "January, February"
Dim months() As String
months = Split( monthString, ", " )
For Each m As String In months
MyPopupMenu.AddRow(m)
Next
[/quote]
Thanks