Oliver Simith
Member
Hi all,
In a sub of a class module, I need to get a b4xview‘s width by using Reflector because the b4xview.width had been set to -2. But the reflector always returns 0.
The code is like:
Thanks for any idea you might have for troubleshooting.
In a sub of a class module, I need to get a b4xview‘s width by using Reflector because the b4xview.width had been set to -2. But the reflector always returns 0.
The code is like:
illustrative code:
'MyCustomClass
sub initialize(parameters)
for i=1 to 5
private btn as b4xview
private b as button
private btn as b4xview=b
mbase.add(btn,0,0,80dip,80dip)
btn.text="HelloWorld"
btn.width=-2 'set the width to fit the text length'
next
end sub
private sub getActualWidth
private b as mbase.getview(3)
reflector.Target=b
private ActualWidth as int= reflector.RunMethod("getWidth")
log(ActualWidth) ' having no clue why the output is always 0
end sub
Thanks for any idea you might have for troubleshooting.