School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!
Welcome to Dream.In.Code
Become an Expert!

Join 340,078 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 4,783 people online right now. Registration is fast and FREE... Join Now!



Resize Form

Page 1 of 1

Resize Form resizing to screen dim Rate Topic: -----

#1 AlexG788  Icon User is offline

  • D.I.C Head
  • PipPip
  • Group: Members
  • Posts: 73
  • Joined: 28-January 09


Dream Kudos: 0

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


#2 prabh  Icon User is offline

  • D.I.C Regular
  • Icon
  • View blog
  • Group: Contributors
  • Posts: 294
  • Joined: 27-December 08


Dream Kudos: 25

Posted 07 April 2009 - 01: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 online

  • Student of Life
  • Icon
  • View blog
  • Group: Admins
  • Posts: 8,830
  • Joined: 26-December 05


Dream Kudos: 500

Expert In: Everything

Posted 07 April 2009 - 02: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
  • PipPip
  • Group: Members
  • Posts: 73
  • Joined: 28-January 09


Dream Kudos: 0

Posted 08 April 2009 - 05: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
  • Pip
  • Group: New Members
  • Posts: 2
  • Joined: 08-April 09


Dream Kudos: 0

Posted 08 April 2009 - 12:36 PM

this should work in vb 2008

 Me.WindowState = FormWindowState.Maximized


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

Was This Post Helpful? 0
  • +
  • -

#6 microstoc  Icon User is offline

  • D.I.C Head
  • PipPip
  • Group: Members
  • Posts: 59
  • Joined: 04-April 09


Dream Kudos: 0

Posted 08 April 2009 - 01: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
  • PipPip
  • Group: Members
  • Posts: 51
  • Joined: 03-May 09


Dream Kudos: 0

Posted 22 June 2009 - 09: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

  • New D.I.C Head
  • Pip
  • Group: Members
  • Posts: 39
  • Joined: 22-June 09


Dream Kudos: 0

Posted 22 June 2009 - 11:41 PM

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
  • Icon
  • Group: Contributors
  • Posts: 93
  • Joined: 30-January 08


Dream Kudos: 75

Posted 23 June 2009 - 01: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
  • PipPip
  • Group: Members
  • Posts: 51
  • Joined: 03-May 09


Dream Kudos: 0

Posted 25 June 2009 - 09:31 PM

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

Page 1 of 1


Fast Reply

  

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month