Solved

Open form in the top right hand corner of screen

Posted on 2016-11-17
5
18 Views
Last Modified: 2016-11-21
Hello,
How to ppen form in the top right hand corner of screen.
Cheers
0
Comment
Question by:RIAS
  • 3
  • 2
5 Comments
 
LVL 12

Accepted Solution

by:
Dustin Saunders earned 500 total points
Comment Utility
On your load event, change the position of the form to the screen area subtracting the width of the form.  Like:

Public Class Form1
    Protected Overrides Sub OnLoad(ByVal e As System.EventArgs)
        Dim scr = Screen.FromPoint(Me.Location)
        Me.Location = New Point(scr.WorkingArea.Right - Me.Width, scr.WorkingArea.Top)
        MyBase.OnLoad(e)
    End Sub
End Class

Open in new window

0
 

Author Comment

by:RIAS
Comment Utility
Thanks Dustin,
Any suggestion on how to open on the right hand side of the other form .
Also, how to set form2 below form1

Cheers
0
 
LVL 12

Expert Comment

by:Dustin Saunders
Comment Utility
You can just set the location of the form to a new point which would be to the right.

Form.Location = New Point(x,y)

Open in new window

This sets the location to whatever x or y position you want.  Just use whatever variable you want for the x position to place it where it should be.

If you place it staggered under the form you want to stay on top, then use Form.BringToFront() to make that form active (on top).
0
 

Author Comment

by:RIAS
Comment Utility
Sorry, Dustin under means ,I meant below.
One below the other
0
 
LVL 12

Assisted Solution

by:Dustin Saunders
Dustin Saunders earned 500 total points
Comment Utility
If you want to open the form below the other, then you would get the location of the first form, then add the height of the form-- and set that as the location for the new one.

So,

Form2.Location = New Point(Form1.Location.X,Form1.Location.Y + Form1.Size.Height)

Open in new window

0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now