Screen resolution independent app

J

John

Hi

How can I develop a screen resolution independent winform app in vb.net? Do
I need a third party tool to achieve this?

Thanks

Regards
 
H

Herfried K. Wagner [MVP]

John said:
How can I develop a screen resolution independent winform app in vb.net?
Do I need a third party tool to achieve this?

What features do you want to be provided? In other words, what's your
definition of a "screen resolution independent" Windows Forms application?
 
M

Michael C

John said:
Hi

How can I develop a screen resolution independent winform app in vb.net?
Do I need a third party tool to achieve this?

NO!! Just write code to move controls around as the main form size change.
You can either use the layoutchange event or the resize event. There are
also options built into dot net to do some of it automatically (Dock and
Anchor properties) but it's not always possible to achieve a perfect result
with them. There are third party controls available but imo they are a waste
of time because doing it yourself is so easy. One thing I would suggest is
if you have multiple controls that you need to move around the form as a
group then place them on a panel.

Michael
 
P

Phill W.

John said:
How can I develop a screen resolution independent winform app in vb.net?

(1) Handle the Form's Layout event and put control-positioning code
therein.
Remember that each "container" control gets its /own/ Layout event; the
Form doesn't have to do it all, any more.

or

(2) Override the OnLayout method and do the same thing.
This is a better alternative if you're creating a "base" Form from which
you intend to inherit /other/ forms. If you go this way, remember to
MyBase.OnLayout() at the end of your routine.

or

(3) Use the Anchor and Dock properties on each Control to get them to
move and resize themselves as the user resizes the window.

Personally, I favour either of the first two, because I've had problems
where VB "forgets" about all the stuff I've set up with properties
(especially when working with inherited Forms).

/Always/ "build small, allow for more".

Design at 800x600 (or whatever /minimum/ resolution you intend to
support) but allow the form to resize to use anything larger.

HTH,
Phill W.
 
W

waqaszahoor

You also can use TableLayoutPanel control and use dock property of other
control..
 
H

Herfried K. Wagner [MVP]

John said:
I want the app to fit on screen in both 800x600 and 1024x768.

Well, that's supported out of the box. Simply set the form's 'WindowState'
property to 'Maximized' and use docking, anchoring and the tablelayoutpanel
and flowlayoutpanel controls.

Note that increasing the size of the controls does not make much sense
because it will make using the application harder if controls get very large
or small.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top