iOS Question Button width and height by code

Discussion in 'iOS Questions' started by Marco Maria Vilucchi, May 15, 2018.

  1. Marco Maria Vilucchi

    Marco Maria Vilucchi Active Member Licensed 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
     
  2. Filippo

    Filippo Expert Licensed User

    You have to make this change in sub page_resize.
     
  3. Marco Maria Vilucchi

    Marco Maria Vilucchi Active Member Licensed User

    I Tried, but nothing....

    Code:
    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
     
  4. Marco Maria Vilucchi

    Marco Maria Vilucchi Active Member Licensed User

    Solved....
    Code:
    Private Sub PageTS_Resize (Width As Int, Height As Int)
     
    Filippo likes this.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice