New topic: Creating controls dynamically.
<http://forums.realsoftware.com/viewtopic.php?t=46099> Page 1 of 1 [ 4 posts ] Previous topic | Next topic Author Message waveuponwave Post subject: Creating controls dynamically.Posted: Fri Nov 30, 2012 8:42 pm Joined: Fri Jan 29, 2010 12:39 pm Posts: 869 Location: Virginia, USA I have a setup screen that has a few controls on it like a text field and static text and buttons. I would like for the user to be able to click an add button and create a new tab with new controls in it. How do you create new controls and name them etc dynamically in code from a button click? Just a little help to get me started would be great. Thanks. _________________ RS 2011 r4 Enterprise on Win 7 Top timhare Post subject: Re: Creating controls dynamically.Posted: Fri Nov 30, 2012 10:08 pm Joined: Fri Jan 06, 2006 3:21 pm Posts: 11856 Location: Portland, OR USA Either 1) Control array - one control already on the window with Index set to 0. 2) ContainerControl Top waveuponwave Post subject: Re: Creating controls dynamically.Posted: Fri Nov 30, 2012 11:13 pm Joined: Fri Jan 29, 2010 12:39 pm Posts: 869 Location: Virginia, USA Thanks Tim, so if I have a control button array on the first setup tab with an index of 0 then I can just reference a new button using index 1 and position it with code and it will create itself dynamically? _________________ RS 2011 r4 Enterprise on Win 7 Top timhare Post subject: Re: Creating controls dynamically.Posted: Fri Nov 30, 2012 11:53 pm Joined: Fri Jan 06, 2006 3:21 pm Posts: 11856 Location: Portland, OR USA Yes. Say you have a pushbutton on the window, named PushButton1 with index 0. dim b as new PushButton1 b.Top = b.Top + 30 Note that you use the name of the instance, PushButton1, not the name of the class, PushButton. Top Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending Page 1 of 1 [ 4 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]
