iOS Question Button width and height by code

Marco Maria Vilucchi

Active Member
Licensed User
Longtime User
Hi all,
I created a form with designer.
Then Ineed to change the image button by code. No problem for it.
New image has a different ratio, then I need to change button width by code.
I do it Sub Initialize.

MyButton.width=MyButton.height*4.5

it doesn't work!!!
Why?
Thanks
Marco
 
D

Deleted member 103

Guest
Hi all,
I created a form with designer.
Then Ineed to change the image button by code. No problem for it.
New image has a different ratio, then I need to change button width by code.
I do it Sub Initialize.

MyButton.width=MyButton.height*4.5

it doesn't work!!!
Why?
Thanks
Marco
You have to make this change in sub page_resize.
 
Upvote 0

Marco Maria Vilucchi

Active Member
Licensed User
Longtime User
I Tried, but nothing....

B4X:
Public Sub Initialize
    PageTS.Initialize("PageTS")
    PageTS.RootPanel.LoadLayout("TipoStru")
.......
.......
End Sub

Private Sub PageTS_Resize
    If Main.RotLingua="IT" Then
        BTRistoranti.Width=BTRistoranti.Height*4.5
    Else
        BTRistoranti.Width=BTRistoranti.Height*6
    End If
End Sub
 
Upvote 0
Top