DREAM
DREAM

Reputation: 426

vb.net fit multiple control form when resize

this is my code

Private Sub maind_Resize(sender As Object, e As EventArgs) Handles Me.Resize
        dataview1.Anchor = AnchorStyles.Top Or AnchorStyles.Bottom Or AnchorStyles.Left Or AnchorStyles.Right
        dataview2.Anchor = AnchorStyles.Top Or AnchorStyles.Bottom Or AnchorStyles.Left Or AnchorStyles.Right
End Sub

when form get resize both control is Overlapping

enter image description here

i want like this enter image description here

Upvotes: 1

Views: 124

Answers (1)

DREAM
DREAM

Reputation: 426

  1. use TableLayoutPanel
  2. put your control in TableLayoutPanel
  3. set your contorl dock = fill

it works perfectly

Upvotes: 1

Related Questions