Form.OnResize : Form « System.Windows.Forms « VB.Net by API






Form.OnResize

  

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

   
    
  








Related examples in the same category

1.Inherits Form
2.Form.AcceptButton
3.Form.Activated
4.Form.AddOwnedForm
5.Form.AutoScaleBaseSize
6.Form.AutoScroll
7.Form.CancelButton
8.Form.Click
9.Form.ClientSize
10.Form.Controls
11.Form.Controls.Add
12.Form.Controls.AddRange
13.Form.CreateGraphics
14.Form.Deactivate
15.Form.Enter
16.Form.FormBorderStyle
17.Form.Icon
18.Form.IsMdiContainer
19.Form.LayoutMdi
20.Form.Leave
21.Form.Load
22.Form.MdiParent
23.Form.Menu
24.Form.MouseDown
25.Form.MouseMove
26.Form.MouseUp
27.Form.OnNotifyMessage
28.Form.OnPaint
29.Form.Opacity
30.Form.Paint
31.Form.Region
32.Form.RemoveOwnedForm
33.Form.Resize
34.Form.ResizeRedraw
35.Form.SetStyle
36.Form.ShowDialog
37.Form.Size
38.Form.StartPosition
39.Form.Text
40.Form.TransparencyKey
41.Form.WndProc