473,394 Members | 1,944 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

screen resolution

Resize a form & controls on it depending on the screen resolution
Jun 6 '08 #1
4 2045
jamesd0142
469 256MB
Could you tell us what version?

I asume your using VB?

James
Jun 6 '08 #2
Curtis Rutland
3,256 Expert 2GB
Expand|Select|Wrap|Line Numbers
  1.  
  2. 'VB      
  3. Dim x, y as Int32
  4.  x = SystemInformation.PrimaryMonitorSize.Width
  5. y = SystemInformation.PrimaryMonitorSize.Height
  6. Me.Size = New Size(x - 20, y - 20)
  7.  
Expand|Select|Wrap|Line Numbers
  1. //c#
  2. int x = SystemInformation.PrimaryMonitorSize.Width;
  3. int y = SystemInformation.PrimaryMonitorSize.Height;
  4. this.Size = new Size(x - 20, y - 20);
  5.  
would set your form to 20 pixels less than your resolution in both dimensions. You can use similar logic to change the size of your controls.
Jun 6 '08 #3
jamesd0142
469 256MB
Here's another example from vb2005

Expand|Select|Wrap|Line Numbers
  1.   Dim a As Rectangle = Screen.PrimaryScreen.WorkingArea
  2.         'Size form
  3.         Me.Width = a.Width
  4.         Me.Height = a.Height
  5.         'Position form
  6.         Me.Top = 0
  7.         Me.Left = 0
  8.  
Jun 6 '08 #4
Plater
7,872 Expert 4TB
There is also:
Expand|Select|Wrap|Line Numbers
  1. Screen.AllScreens
  2.  
Which gives an array of screens to check for screen resolutions on.


I think there is also a way to tell which screen your window currently resides on, but I cannot seem to find it.
Jun 9 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

23
by: Dufe | last post by:
Hello all: To deal with the problem of differing user screen resolutions, I've explored: 1) making the pages in PHP, 2) having different pages on the same page and selecting the proper one via...
5
by: Maxi | last post by:
I have a 30X16 cells table in my html page. Table height and width are set to 100%. I have set size of every cell inside the table to 24 pixel. When I open the html page in maximize state in...
9
by: Steve Wright | last post by:
Hi I'm developing a webpage that needs to include a different stylesheet depending on the screen resolution. I know that I could read the resolution in javascript and then do some sort of...
1
by: nasima khan | last post by:
Hi, i am nasima. I have got a code for setting the screen resolution of my page, but i am unable to understand. Can any one give a complete data explanation of the below code. Sub ChangeRes(X...
10
by: =?Utf-8?B?UmljaA==?= | last post by:
A lot of users at my workplace use different screen resolutions, and I build apps to use 1680 x 1050 pixels res by default. But some users are using 800 x 600, and the apps are too large for their...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.