Resize Form
Page 1 of 1
Resize Form resizing to screen dim
#1
Posted 07 April 2009 - 12:58 PM
Hi,
I'm trying to figure out how to resize a form on load to fit to the user's screen. Many of my users are on laptops, or split screens between laptop and monitor..
I remember in VB6, it was something like form.height = screen.height (or something of the sort)... but I can't find this functionality in VB.NET 2008
Let me know. I'm also trying to wrap everything (multiple screens/forms) into one app, so I wanted to know if anyone was aware of any tutorials on form parent/child relationships... I don't want to keep opening and hiding forms individually without having them packaged in one work area....
Thanks as always!
I'm trying to figure out how to resize a form on load to fit to the user's screen. Many of my users are on laptops, or split screens between laptop and monitor..
I remember in VB6, it was something like form.height = screen.height (or something of the sort)... but I can't find this functionality in VB.NET 2008
Let me know. I'm also trying to wrap everything (multiple screens/forms) into one app, so I wanted to know if anyone was aware of any tutorials on form parent/child relationships... I don't want to keep opening and hiding forms individually without having them packaged in one work area....
Thanks as always!
#2
Posted 07 April 2009 - 01:27 PM
AlexG788, on 7 Apr, 2009 - 12:58 PM, said:
Hi,
I'm trying to figure out how to resize a form on load to fit to the user's screen. Many of my users are on laptops, or split screens between laptop and monitor..
I remember in VB6, it was something like form.height = screen.height (or something of the sort)... but I can't find this functionality in VB.NET 2008
Let me know. I'm also trying to wrap everything (multiple screens/forms) into one app, so I wanted to know if anyone was aware of any tutorials on form parent/child relationships... I don't want to keep opening and hiding forms individually without having them packaged in one work area....
Thanks as always!
I'm trying to figure out how to resize a form on load to fit to the user's screen. Many of my users are on laptops, or split screens between laptop and monitor..
I remember in VB6, it was something like form.height = screen.height (or something of the sort)... but I can't find this functionality in VB.NET 2008
Let me know. I'm also trying to wrap everything (multiple screens/forms) into one app, so I wanted to know if anyone was aware of any tutorials on form parent/child relationships... I don't want to keep opening and hiding forms individually without having them packaged in one work area....
Thanks as always!
hi
if you change form property
of window state to maximized it will take the size of the end-users screen
#4
Posted 08 April 2009 - 05:24 AM
Jayman, on 7 Apr, 2009 - 02:37 PM, said:
I think you are looking for:
Me.Height = Screen.Height
screen.height for some reason is not a function of VB.NET 2008.... unless I'm not referencing something I should be... when i insert this statement into my code, VS underlines it and says:
Height is not a member of system.windows.forms.screen]
Also if I select Maximized in the Window State (properties) box, nothing happens, its still the original size
#6
Posted 08 April 2009 - 01:33 PM
zhaynes, on 8 Apr, 2009 - 12:36 PM, said:
this should work in vb 2008
Me.WindowState = FormWindowState.Maximized
I don't know if this helps, but it seems relevant.
'actual screen dimensions
Dim ScreenWidth as Integer = Screen.PrimaryScreen.Bounds.Width
Dim ScreenHeight as Integer = Screen.PrimaryScreen.Bounds.Height
'actual working area (i.e. actual screen dimensions less the taskbar dimensions etc)
Dim FormTop as Integer = Screen.PrimaryScreen.WorkingArea.Top
Dim FormLeft as Integer = Screen.PrimaryScreen.WorkingArea.Left
Dim FormRight as Integer = Screen.PrimaryScreen.WorkingArea.Right
Dim FormBottom as Integer = Screen.PrimaryScreen.WorkingArea.Bottom
Dim FormHeight as Integer = Screen.PrimaryScreen.WorkingArea.Height 'FormBottom-FormTop
#8
Posted 22 June 2009 - 11:41 PM
#9
Posted 23 June 2009 - 01:07 AM
yangma, on 23 Jun, 2009 - 07:40 AM, said:
okai...if it is maximized then it fits into the screen..but the control and buttons and textboxes will be there in its original place..how can i move the buttons along with the size of the form...
thanks
thanks
Take a look at every control properties -box, there should be an anchor- selection.
Thius is what tells to your program in witch borders are components anchored, so which border is that which moves the component along.
Page 1 of 1

Add Reply





MultiQuote


| 


