Nathan Duncalf
Nathan Duncalf

Reputation: 15

How do I position a form to be top centre of the screen in VB

I want to have a toolbar style application that will sit at the top of the screen - in the middle but unsure on what code to use to make this happen automatically.

There is no customer position option - like there was back in the old VB days. Can anybody help me?

Upvotes: 1

Views: 5422

Answers (1)

Dave 5709
Dave 5709

Reputation: 625

Add this in Form_Load:

Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
    CenterToScreen()
    Top = 0
End Sub

Upvotes: 5

Related Questions