Control Dynamic Size Location : Control Size Location « GUI « VB.Net Tutorial






Control Dynamic Size Location
imports System
imports System.Drawing
imports System.Windows.Forms

public class ControlDynamicSizeLocation : inherits Form

  private WithEvents btnShow as Button

  public sub New()
    btnShow = new Button()
    btnShow.Parent = me

    Size = new Size(350,400)

    btnShow.Size = new Size(20, 20)

    OnResize(EventArgs.Empty)
  end sub

  protected overrides sub OnResize(ByVal e as EventArgs)
    MyBase.OnResize(e)
    
    
    btnShow.Location = new Point(me.ClientSize.Width/10, me.ClientSize.Height/10)
  end sub

  public shared sub Main() 
    Application.Run(new ControlDynamicSizeLocation())
  end sub
end class








14.76.Control Size Location
14.76.1.Set Control BoundsSet Control Bounds
14.76.2.Get Control Location and SizeGet Control Location and Size
14.76.3.Control Dynamic Size LocationControl Dynamic Size Location
14.76.4.Resize controlsResize controls