New topic: Iterate through controls in a window
<http://forums.realsoftware.com/viewtopic.php?t=29236> Page 1 of 1 [ 2 posts ] Previous topic | Next topic Author Message Roland Foster Post subject: Iterate through controls in a windowPosted: Sun Jul 26, 2009 7:58 am Joined: Sat Jan 12, 2008 12:54 pm Posts: 12 I've looked, but haven't found how to do this. I'd like to iterate through all of the controls in a window. If any control has a HelpTag, I'd like to save the control's TabIndex and HelpTag, then remove the HelpTag from the control. This is probably easy if you know how. Top sphauck Post subject: Re: Iterate through controls in a windowPosted: Sun Jul 26, 2009 8:35 am Joined: Tue Jul 31, 2007 1:35 pm Posts: 44 if you look in the Language reference it shows that there is a property of the Window type named "Control" that is defined as "The zero-based array of the controls in the window." Here is an example from the users guide (page 542), you could change this to be a global function and then pass the control array to it. For i = 0 to Self.ControlCount-1 //number of controls in window If Self.control(i) IsA EditField then fieldname = EditField(control(i)).DataField //cast it //the text property assigned to the contents of that field fieldContents = EditField(control(i)).text //cast the control as an EditField r.column(fieldname)= fieldContents End if Next Back in the day the class library we used in PowerBuilder woudl scan the controls into a DB and then you could apply translations, help text and security levels by control name, is this what you are aiming to do? Stephen Top Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending Page 1 of 1 [ 2 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]
