It has been long time since I worked with the ListBox. I forgot how to get a text from the cell in a ListBox.
I will need to create the following functionality
Scrolling through the fields in the ListBox will be switching pages in the PagePanel.
Thank you in advance,
I would start by looking at the events and properties of the Listbox. http://documentation.xojo.com/index.php/Listbox
Thank you for the advice - I found my old project with the code there.
Dim a1,a2,a3,a4,a5,a6,a7,a8,a9,a10 As String
if ListBox1.text=a1 then
elseif ListBox1.text=a2 then
elseif ListBox1.text=a3 then
elseif ListBox1.text=a4 then
elseif ListBox1.text=a5 then
elseif ListBox1.text=a6 then
elseif ListBox1.text=a7 then
elseif ListBox1.text=a8 then
elseif ListBox1.text=a9 then
elseif ListBox1.text=a10 then
One thing is left to figure out - how to count the number of rows in the ListBox (it will be dynamically populated) and create a corresponding number string variables with the corresponding number of “If … then” statements.
I am pretty sure it must be done through the arrays and looping but I have to figure out the code.
I would appreciate any help with this regard.
Ok, got to the ListBox1.ListCount property. Working on how to create a ListCount + 1 number of string properties.
What about simply
PagePanel1.Value = Listbox1.ListIndex+1
Listbox1.Text is the cell value of the row Listbox1.ListIndex. ListIndex is zero-based, so you have to add 1.
Tim, you made me laugh because your one line code simply worked!
You are a genius!
Thank you very much for your help.
Tim, on the second thought, that code will not work for me.
In my case the PagePanel will have a large number of the pages.
The CheckList will be dynamically populated. When the row is changed, the value of the row should be obtained, and then the PagePanel should be set to the corresponding page.
It is a little more complicated. If I had a static CheckList, your code would work perfectly.
Again, thank you for your help. I will remember your little piece of wisdom for my future references.
Thank you, again,