New topic: Clearing GUI Form
<http://forums.realsoftware.com/viewtopic.php?t=43935> Page 1 of 1 [ 3 posts ] Previous topic | Next topic Author Message wex-alpha Post subject: Clearing GUI FormPosted: Wed May 09, 2012 9:35 am Joined: Mon Jul 30, 2007 5:03 am Posts: 92 Location: Sarajevo - Bosnia Hello, In the project that we work on, many forms will have many text fields at the same time. Now instead of doing: textbox.Text = "" // times 100 or so Is there a way to force a form(Window) to "purge / empty" only textbox controls???? Thanks Top Jason_Adams Post subject: Re: Clearing GUI FormPosted: Wed May 09, 2012 9:51 am Joined: Fri Nov 10, 2006 4:10 pm Posts: 1557 Location: Michigan, USA Yes, you would do something like this: Sub ClearFields() Dim Field As Control For Index As Integer = (Self.ControlCount - 1) DownTo 0 Field = Self.Control(Index) Select Case Field Case IsA TextField TextField(Field).Text = "" Case IsA TextArea TextArea(Field).Text = "" End Select Next End Sub That's pure forum code, so there may be errors, but that's basically one way of how it's done. Other methods will vary slightly. Hope this helps. _________________ Windows 7 Ultimate x64 Windows XP Pro SP3 Ubuntu 11.04 via Virtual Box RS Enterprise 2011r4 Programming Tutorials & Free Projects: http://www.JasonTheAdams.com "Christianity has not been tried and found wanting; it has been found difficult and not tried." - G.K. Chesterton Top wex-alpha Post subject: Re: Clearing GUI FormPosted: Wed May 09, 2012 9:56 am Joined: Mon Jul 30, 2007 5:03 am Posts: 92 Location: Sarajevo - Bosnia WOW Thanks for the answer. Yes, that will do the trick 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]
