Resize Form

resizing to screen dim

Page 1 of 1

9 Replies - 17001 Views - Last Post: 25 June 2009 - 10:31 PM Rate Topic: -----

#1 AlexG788  Icon User is offline

  • D.I.C Head

Reputation: 4
  • View blog
  • Posts: 76
  • Joined: 28-January 09

Resize Form

Post icon  Posted 07 April 2009 - 01: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!

Is This A Good Question/Topic? 0
  • +

Replies To: Resize Form

#2 prabh  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 3
  • View blog
  • Posts: 381
  • Joined: 27-December 08

Re: Resize Form

Posted 07 April 2009 - 02:27 PM

View PostAlexG788, 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!

hi
if you change form property
of window state to maximized it will take the size of the end-users screen
Was This Post Helpful? 0
  • +
  • -

#3 Jayman  Icon User is offline

  • Student of Life
  • member icon

Reputation: 418
  • View blog
  • Posts: 9,532
  • Joined: 26-December 05

Re: Resize Form

Posted 07 April 2009 - 03:37 PM

I think you are looking for:

Me.Height = Screen.Height

Was This Post Helpful? 0
  • +
  • -

#4 AlexG788  Icon User is offline

  • D.I.C Head

Reputation: 4
  • View blog
  • Posts: 76
  • Joined: 28-January 09

Re: Resize Form

Posted 08 April 2009 - 06:24 AM

View PostJayman, 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
Was This Post Helpful? 0
  • +
  • -

#5 zhaynes  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 08-April 09

Re: Resize Form

Posted 08 April 2009 - 01:36 PM

this should work in vb 2008

 Me.WindowState = FormWindowState.Maximized


This post has been edited by zhaynes: 08 April 2009 - 01:37 PM

Was This Post Helpful? 0
  • +
  • -

#6 microstoc  Icon User is offline

  • D.I.C Head

Reputation: 6
  • View blog
  • Posts: 59
  • Joined: 04-April 09

Re: Resize Form

Posted 08 April 2009 - 02:33 PM

View Postzhaynes, 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
Was This Post Helpful? 1

#7 yangma  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 51
  • Joined: 03-May 09

Re: Resize Form

Posted 22 June 2009 - 10:40 PM

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
Was This Post Helpful? 0
  • +
  • -

#8 zippp  Icon User is offline

  • D.I.C Head

Reputation: 7
  • View blog
  • Posts: 76
  • Joined: 22-June 09

Re: Resize Form

Posted 23 June 2009 - 12:41 AM

View Postyangma, on 22 Jun, 2009 - 09:40 PM, 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


can you post a printscreen with your project?
Was This Post Helpful? 0
  • +
  • -

#9 TEH  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 29
  • View blog
  • Posts: 152
  • Joined: 30-January 08

Re: Resize Form

Posted 23 June 2009 - 02:07 AM

View Postyangma, 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


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.
Was This Post Helpful? 1

#10 yangma  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 51
  • Joined: 03-May 09

Re: Resize Form

Posted 25 June 2009 - 10:31 PM

thanks ..anchor property was not set accordingly...
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1