Launch a VB.NET dialogbox in a specific location from Namespace

Hello Experts:

I am trying to show a startup dialog box in a specific screen location. The catch is that I am trying to do it from the Namespace of VB.NET.

Presently, my launch code is:

Application.MainForm = New frmHelloWorld

which works, but does not position the dialogbox in any particular location.  I have tried to change the code to the following, which includes some positional logic:

Dim db As New frmHelloWorld
db.Location = PointToScreen(New Point(4, 73))
But, it doesn't like "PointToScreen" which I thought was fair game in VB.NET.

Am I doing anything right here?

Who is Participating?
Mike TomlinsonConnect With a Mentor Middle School Assistant TeacherCommented:
Set the StartPosition() to MANUAL:
Dim HW As New frmHelloWorld
            HW.StartPosition = FormStartPosition.Manual
            HW.Location = New Point(4, 73)
            Application.MainForm = HW

Open in new window

There is not a lot out there on this topic. This is about as close as one can get I think:
gbmcneilAuthor Commented:
Hello Idle -

Gee, that works great!  But, what does this mean, "FormStartPosition.Manual"?

As opposed to "Automatic"?
Mike TomlinsonMiddle School Assistant TeacherCommented:
Instead of "Automatic" we have "WindowsDefaultLocation".

See FormStartPosition():

    Manual --> The position of the form is determined by the Location property.

    WindowsDefaultLocation --> The form is positioned at the Windows default location and has the dimensions specified in the form's size.

gbmcneilAuthor Commented:
Thanks again for your help.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.