
ListBox1.Cell(5, 1) = "Mu" //Me.LastIndex ListBox1.Cell(4, 1) = "De" //Me.LastIndex
#Xojo listbox code
Create new Method and name it showplaces and use the code to add rows with our positions. We will display the list of all Places when they are open. G.ForeColor = RGB(EndColor.Red * endratio + StartColor.Red * ratio,ĮndColor.Green * endratio + StartColor.Green * ratio, EndColor.Blue * endratio + StartColor.Blue * ratio) If Listbox1.Active = false or Listbox1.Enabled = false then Dim i As integer, ratio, endratio As Doubleĭim StartColor, EndColor, TopColor As Color We need to select from menu Insert -> Method and name it gradient. Let's add 3 Methods to show places, hide places and generate blue gradient when selecting our position. if selected row and row number is (Movies) then change the Window title text to row text if selected row and row number is 1 (REALbasic City) then not needed but you can use it to take action clicking specific link Use this code to draw pictures next to text and an arrow next to Places. Next step is CellTextPain EventHandler for Listbox1 control. This property will store the value if our list is open or closed. Change it Type to Boolean and Default value to true. Now we will create Property named showlist. if selected row is different than 0 (PLACES) then draw gradient select

If me.Selected(row) and row > 0 then gradient(g) For purpose of this tutorial we will use menu Insert -> Event Handler -> CellBackgroundPaint. Create for Listbox1 CellBackgroundPaint EventHandler. This time we will try something new - Methods to hide and show the list.įirst we need to drag and drop to Window a Listbox1 control from Xojo Library. We will use also the technics from previous tutorial to create different, but still interesting look. Before we will start I like to recommend you to check my previous tutorial Create custom look for Listbox component in Xojo IDE to see quite different style that can be created using the same ListBox component.
