Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 26-01-2009
Member
 
Join Date: Nov 2008
Posts: 1,514
Making the Form bottom right

Just wondering if anyone has a way to do this, that works, that they can recommend. Would like it so that my program do all the way down to the right when it starts up, that is on the main screen, right above the clock and system tray. Tried to put Location by using screenbounds and withdraw from the height and width, but then found only 1 / 4 of the window, then the other 3 / 4 was off the screen and both down on the side. Something I do not completely made. So when I wondered if there was maybe something muffins with these screen bounds issues. Some who have mirrors?
Reply With Quote
  #2  
Old 26-01-2009
Member
 
Join Date: May 2008
Posts: 3,971
Re: Making the Form bottom right

Have you tried with Screen.PrimaryScreen.WorkingArea ? If not try this code:

Code:
this.Location = new Point (Screen.PrimaryScreen.WorkingArea.Width - this.Width, Screen.PrimaryScreen.WorkingArea.Height - this.Height);
Reply With Quote
  #3  
Old 26-01-2009
XSI XSI is offline
Member
 
Join Date: May 2008
Posts: 271
Re: Making the Form bottom right

Quote:
Originally Posted by switchblade327 View Post
Have you tried with Screen.PrimaryScreen.WorkingArea ? If not try this code:

Code:
this.Location = new Point (Screen.PrimaryScreen.WorkingArea.Width - this.Width, Screen.PrimaryScreen.WorkingArea.Height - this.Height);
The code works poorly, if start is not located in the bottom ...

Below code takes into account the start: (it is in VB.NET, convert it to C# even)

Code:
 
Public Shared Sub SetLoc(ByVal FName As System.Windows.Forms.Form, ByVal Padding As Integer, ByVal ScrLoc As Publics.Lcs) 

Dim XLoc As Integer 
Dim YLoc As Integer 

YLoc = System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Height - FName.Size.Height 
XLoc = System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Width - FName.Size.Width 

If ScrLoc = Publics.Lcs.Upper_Left Then 
FName.Location = New System.Drawing.Point (Padding + Screen.PrimaryScreen.WorkingArea.X, Padding + Screen.PrimaryScreen.WorkingArea.Y) 
Elseif ScrLoc = Publics.Lcs.Upper_Right Then 
FName.Location = New System.Drawing.Point (XLoc - Padding + Screen.PrimaryScreen.WorkingArea.X, Padding + Screen.PrimaryScreen.WorkingArea.Y) 
Elseif ScrLoc = Publics.Lcs.Bottom_Left Then 
FName.Location = New System.Drawing.Point (Padding + Screen.PrimaryScreen.WorkingArea.X, YLoc - Padding + Screen.PrimaryScreen.WorkingArea.Y) 
Elseif ScrLoc = Publics.Lcs.Bottom_Right Then 
FName.Location = New System.Drawing.Point (XLoc - Padding + Screen.PrimaryScreen.WorkingArea.X, YLoc - Padding + Screen.PrimaryScreen.WorkingArea.Y) 
End If 

End Sub 

Public Enum LCS As Integer 

Upper_Left = 1 
Upper_Right = 2 
Bottom_Left = 3 
Bottom_Right = 4 

End Enum
Reply With Quote
  #4  
Old 26-01-2009
Member
 
Join Date: Nov 2008
Posts: 1,514
Re: Making the Form bottom right

Quote:
Originally Posted by switchblade327 View Post
Have you tried with Screen.PrimaryScreen.WorkingArea ? If not try this code:

Code:
this.Location = new Point (Screen.PrimaryScreen.WorkingArea.Width - this.Width, Screen.PrimaryScreen.WorkingArea.Height - this.Height);
So it works, yes. Strange ... was sure it was about what I had done before ... must have been with some muffins in my code. Anyways thanks for your help.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Making the Form bottom right"
Thread Thread Starter Forum Replies Last Post
Google Chrome is opening in basic HTML form instead of the Standard form Beatrix Technology & Internet 5 25-05-2011 10:21 PM
how to get items in a form to auto-resize with the form using visual basic deansmylie93 Software Development 2 02-05-2011 07:06 AM
How to Auto Populate fields from sub form to form? mich43 Windows Software 6 09-11-2010 11:29 PM
Procedure in VB to create form inside another form Jalabala Software Development 3 16-11-2009 02:14 PM
Problem reloading MDI child form in main form. AFFAN Software Development 3 30-01-2009 09:05 PM


All times are GMT +5.5. The time now is 08:03 PM.