New topic: listbox values
<http://forums.realsoftware.com/viewtopic.php?t=38194> Page 1 of 1 [ 3 posts ] Previous topic | Next topic Author Message horhay64 Post subject: listbox valuesPosted: Fri Mar 18, 2011 6:11 pm Joined: Fri Mar 18, 2011 6:00 pm Posts: 1 Hi everyone, I am completely new to RealStudio and programming in general. I've look through the user's guide and tutorials and have come up empty handed. I have a listbox with certain items in the list. What I want to do is when a user selects a certain line item in the listbox, I'd like to have the value of that item displayed in a text field somewhere else in the application. Can anyone steer my in the right direction or maybe even provide some sample code that I could work with. Top Jym Post subject: Re: listbox valuesPosted: Fri Mar 18, 2011 6:21 pm Joined: Sat Oct 01, 2005 5:19 pm Posts: 2298 Depends on where you are keeping the value of the item before someone can tell you how to code it, but you'd use the CellClick event to set the textfield.Text = ItemsValue Top timhare Post subject: Re: listbox valuesPosted: Sat Mar 19, 2011 2:06 am Joined: Fri Jan 06, 2006 3:21 pm Posts: 9490 Location: Portland, OR USA When the user selects a row in the listbox, the Change event fires. In the Change event, me.ListIndex is the row that was selected. If the list has just one column, then me.Text contains the contents of the selected item. Otherwise, you would use me.Cell(me.ListIndex, some-column-number). For a single column listbox, in the Change event put Code:someTextField.Text = me.Text Top Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending Page 1 of 1 [ 3 posts ] -- Over 1500 classes with 29000 functions in one REALbasic plug-in collection. The Monkeybread Software Realbasic Plugin v9.3. http://www.monkeybreadsoftware.de/realbasic/plugins.shtml [email protected]
