and 4 buttons, the button’s text based from Listbox row content.
what I need is, if i do clicking the row, if the button text is equal with row selected text, then bold the text of button.
Does this method is possible to do it in xojo ?
the code is work only on a pushbutton1,
I have 4 PushButtons, if I do select the row with equal text, the result could be button 1, 2,3 or 4, not only in button1
A control set might be cleaner if the number of buttons varies at all. So if your PushButton’s are in a control set then this code in the ListBox.Change event handler would work:
For i As Integer = 0 To 3
PushButton1(i).Bold = Me.List(Me.ListIndex) = PushButton1(i).Caption
Next
Wow, Paul… I just started to write exactly that suggestion. But I got a call and ran off. Now you beat me to it.
Yes, a controlSet is what I often use in this case.
I kind of do the same thing with a PagePanel and a bunch of buttons in a controlSet. I loop through the pages and style the buttons accordingly.
I use Rounded and Recessed buttons to tell which page I have selected. This way I have a nice clean Tab Panel, kind of thing.