Dim ctrl as control
For each ctrl in Me.controls
[do something]
Next ctrl
dim i as integer
dim c as Control
dim dg as thecontrolIwanttoget
dg = nil
for i=1 to self.ControlCount
c = self.Control(i-1)
if c isa thecontrolIwanttoget then
dg = thecontrolIwanttoget(c)
Exit
end if
next
return dg
--
Jean-Yves.
Thanks, that works as far as getting a handle on the control.
The reason I need to do this is that my app has different font sizes in
StaticText and TextField controls depending on what platform it runs on
even though the project is set to -
Font: System
Fontsize: 11
On Windows it is fine, on Mac a little big and Linux Ubuntu far too large.
I want to run a function on each Window open event which will set the
Textsize of StaticText and EditFields depending on the platform.
Your code works fine for StaticText but makes no difference to
Textfields eg.
#If TargetLinux then
if c isa TextField then
dg = TextField(c)
dg.TextSize = 10 //makes no difference !!!
Am I doing this the hard way?
you need to select the text in order to chnage its font size ...
--
Jean-Yves.
Sorry I don't understand how to automatically select a controls text.
I tried .selectAll & then .SelText
I've just found out this is a bug with Realbasic and not a programming
error -
http://www.mail-archive.com/rbforum...@monkeybreadsoftware.de/msg09325.html
This is a bug which is fixed in version 2009 R4
From the release notes -
� Windows: setting the TextField font and font size programmatically now
works.
Sorry to bother you, thanks for your help with getting me started.