Click here to Skip to main content
15,881,248 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I set screen resolution to 1024*768 to my vb.net application. But my client have 800*600 resolution. How to automatic adjust that resolution in vb.net. How to set dynamic screen resolution based on windows default size.
Posted
Comments
dcba1 13-Mar-12 3:18am    
if i use anchor property for the controls on my form some of data on form get lost. I have one checkedlistbox on form. I used anchor property for that. It shows only 3 items from the list.

It is never recommended to adjust a users screen resolution from an application. What happens if the users monitor's maximum resolution is 800 X 600 ? As a user I would really be upset if an application changed my screen resolution. As a solution to this problem Winforms has properties such as Dock and Anchor[^] which can be used to appropriately set the dimensions of controls depending on the users resolution. See article here[^] . If you find that your application cannot be viewed in any resolution less than say 1024 X 768, then you need to state this as a requirement for running this application, and let the user select what to do from there.

Hope this helps.
 
Share this answer
 
Comments
dcba1 10-Mar-12 3:07am    
form doesn't have properties such as Dock and Anchor. Label or button have that property. If I set the property for form resolution then it will automatically adjust all controls on the form.
Wayne Gaylard 10-Mar-12 3:16am    
Yes, the properties are on the controls themselves. You need to read the article I linked to about these properties.
Sergey Alexandrovich Kryukov 11-Mar-12 0:20am    
All controls have. You should use Dock and Padding, basically.
--SA
dcba1 10-Mar-12 3:22am    
Is there other option to screen resolution. Can we set screen resolution dynamically?
Wayne Gaylard 10-Mar-12 3:26am    
Just read my first two sentences.
Wayne is right. Please see my past answer of resolution-tolerant design and UI design:

Zom Out malfunctions when Screen resolution changes[^].

Minimalistic code sample for Forms here:
how to dock button so that it can adjust with the form[^].

See also:
GUI Apperance - C#.Net[^].

—SA
 
Share this answer
 
Comments
dcba1 13-Mar-12 5:31am    
if i use anchor property for the controls on my form some of data on form get lost. I have one checkedlistbox on form. I used anchor property for that. It shows only 3 items from the list.
Sergey Alexandrovich Kryukov 14-Mar-12 3:41am    
That happens, especially if you overuse the Designer. It's not lost, it can be closed by some other panel. You just need to build the layout hierarchically and very accurately. Also, I usually advice to avoid anchor and use only Dock and Padding.
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900