473,395 Members | 1,652 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,395 software developers and data experts.

Resizing windows and controls

Hi,

In design mode I built some windows with some controls (e.g.
listboxes, labels, chgeck boxes etc.) in it, and I did set
the property for the window size is set to normal.

Now, when I run my app the first user's action is to
maximize the window, but the controls inside the window are
not resized simultaneously with my window, resulting in a
real meshy window.

Of course, I read something about *anchoring*, but I don't
hope I need to anchor all (20) my controls for pretty
resizing.

So, is there an easy way to do this, maybe by setting a
single window property.

Some help would be nice.

Thanks,
Chris

Nov 16 '05 #1
8 15024
I haven't heard of such. Better read more about anchoring and docking -
you'll see it's not such a heavy burden.

Nov 16 '05 #2
For complex apps you really can't get out of rolling your own Layout Engine.

As an example, see one of the third party solutions such as SandDock for
controls or SandBar for toolbars:
http://www.divil.co.uk/net/

For simple apps, why not just employ a Fixed (unresizable) window?

myForm.FormBorderStyle = FormBorderStyle.Fixed3D;

ok,
aq
"Chris" <An*****@work.nl> wrote in message
news:11***************@wgsvr01.wldelft.nl...
Hi,

In design mode I built some windows with some controls (e.g.
listboxes, labels, chgeck boxes etc.) in it, and I did set
the property for the window size is set to normal.

Now, when I run my app the first user's action is to
maximize the window, but the controls inside the window are
not resized simultaneously with my window, resulting in a
real meshy window.

Of course, I read something about *anchoring*, but I don't
hope I need to anchor all (20) my controls for pretty
resizing.

So, is there an easy way to do this, maybe by setting a
single window property.

Some help would be nice.

Thanks,
Chris

Nov 16 '05 #3
I dont agree to this. My experience with complex apps, basically complex
forms and 3rd party Resizers has been pathetic. I would suggest you get on
with the good habit of anchoring, docking controls. You should use panels
for this, and then resize. If the forms are quite simple though, you can use
3rd party resizers, like XSizer etc.

Ranjan

--
http://dotnetjunkies.com/weblog/dotnut


"Ahmed Qurashi" <ah**********@gmail.com> wrote in message
news:Oh**************@TK2MSFTNGP15.phx.gbl...
For complex apps you really can't get out of rolling your own Layout Engine.
As an example, see one of the third party solutions such as SandDock for
controls or SandBar for toolbars:
http://www.divil.co.uk/net/

For simple apps, why not just employ a Fixed (unresizable) window?

myForm.FormBorderStyle = FormBorderStyle.Fixed3D;

ok,
aq
"Chris" <An*****@work.nl> wrote in message
news:11***************@wgsvr01.wldelft.nl...
Hi,

In design mode I built some windows with some controls (e.g.
listboxes, labels, chgeck boxes etc.) in it, and I did set
the property for the window size is set to normal.

Now, when I run my app the first user's action is to
maximize the window, but the controls inside the window are
not resized simultaneously with my window, resulting in a
real meshy window.

Of course, I read something about *anchoring*, but I don't
hope I need to anchor all (20) my controls for pretty
resizing.

So, is there an easy way to do this, maybe by setting a
single window property.

Some help would be nice.

Thanks,
Chris


Nov 16 '05 #4
> For simple apps, why not just employ a Fixed (unresizable)
window?

The problem is that in design mode you can't design a full
screen window, as it does not fit in the proper window in
Visual Studio .NET. So, you design a window of moderate
size with the all controls in it, and then at runtime the
user will maximize it for better visibility.

I remember for other GUI designers (XVT designer) that you
did not have to do anything to get this behaviour. It was
the default behaviour. Imho resizing a window MUST always
result in resizing all controls in it.
I can hardly imagine why you would NOT want this behaviour
.....

Chris.

Nov 16 '05 #5
Chris,
There are some cases where the font size will become an issue when
the size controls grow. Its hard to explain, its not logical but aesthetic
:)

--
http://dotnetjunkies.com/weblog/dotnut


"Chris" <An*****@work.nl> wrote in message
news:11***************@wgsvr01.wldelft.nl...
For simple apps, why not just employ a Fixed (unresizable)

window?

The problem is that in design mode you can't design a full
screen window, as it does not fit in the proper window in
Visual Studio .NET. So, you design a window of moderate
size with the all controls in it, and then at runtime the
user will maximize it for better visibility.

I remember for other GUI designers (XVT designer) that you
did not have to do anything to get this behaviour. It was
the default behaviour. Imho resizing a window MUST always
result in resizing all controls in it.
I can hardly imagine why you would NOT want this behaviour
....

Chris.

Nov 16 '05 #6
I can easily imagine why you would not want this behaviour. To see why,
ask yourself, what does "resizing all controls" mean?

Does it mean that every control gets bigger or smaller according to the
new window size, so everything scales proportionally? Or does it mean
that the controls move with the new window boundaries, while one
principal control (such as a list view or data grid) expands to fill
the remaining space? Or does it mean that most controls follow the
window boundary while two or three controls share the remaining space
evenly? All of these are reasonable designs for what to do when a
window changes shape, which is exactly why the .NET Framework doesn't
provide a default. You have to decide what happens and design the form
accordingly.

I have to admit that for me this wasn't too difficult, as I came from
the Java world in which you have to supply layout managers with your
forms. .NET is a bit more tedious (although I hear that they are
introducing more powerful layout classes in V2.0). For now you have to
use docking and anchoring, and place controls within panels within
panels to get nice resizing behaviour. It's really not that much work:
it's all drag and drop and setting properties in the forms designer.

However, no, there is no "make this form pretty" flag, because the
definition of "pretty" is different for every application.

Nov 16 '05 #7
Perhaps intuitively the default would scale all controls when the form is
resized but for WinForms 1.0 the default is the Fixed or Grid style. There
is no flow.

I think the original intention was to provide a high degree of extensibility
within the framework. Of course that requires handling all the events that
can alter controls, not just user interaction but also content change, etc.
So the short answer is there is no magic "makepretty" switch, but building a
custom layout engine that uses anchoring, docking and event handlers to get
what you want isn't so dificile either:
http://windowsforms.net/articles/cus...utengines.aspx

In Avalon, with scalable vector based graphics, there is something I've seen
referred to as Dynamic Flow. When a resize event occurs, controls can scale
and re-dock automatically. Layout is handled through the form rendering
engine. It's still in Preview, unfortunately:
http://www.microsoft.com/downloads/d...displaylang=en

ok,
aq

"Chris" <An*****@work.nl> wrote in message
news:11***************@wgsvr01.wldelft.nl...
For simple apps, why not just employ a Fixed (unresizable)

window?

The problem is that in design mode you can't design a full
screen window, as it does not fit in the proper window in
Visual Studio .NET. So, you design a window of moderate
size with the all controls in it, and then at runtime the
user will maximize it for better visibility.

I remember for other GUI designers (XVT designer) that you
did not have to do anything to get this behaviour. It was
the default behaviour. Imho resizing a window MUST always
result in resizing all controls in it.
I can hardly imagine why you would NOT want this behaviour
....

Chris.

Nov 16 '05 #8
Try reading up on Control's Anchor and Docking properies. Use these
two properties in combination with panel and you get a powerfull way
of laying out ur control. I made some pretty complex form with lots of
controls just by using panels and that two properties. Remember, you
can put one panel inside the other.

On Mon, 24 Jan 2005 18:23:33 +0100, "Chris" <An*****@work.nl> wrote:
Hi,

In design mode I built some windows with some controls (e.g.
listboxes, labels, chgeck boxes etc.) in it, and I did set
the property for the window size is set to normal.

Now, when I run my app the first user's action is to
maximize the window, but the controls inside the window are
not resized simultaneously with my window, resulting in a
real meshy window.

Of course, I read something about *anchoring*, but I don't
hope I need to anchor all (20) my controls for pretty
resizing.

So, is there an easy way to do this, maybe by setting a
single window property.

Some help would be nice.

Thanks,
Chris


Nov 16 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: JV | last post by:
Is it possible to create a listbox in which the items are windows controls ? For example a listbox of buttons. If so please can somone point me to some sample code (preferably c#) to do it. ...
2
by: Vaughn | last post by:
Where can I get information on automatic resizing of controls when the form changes size (eg. if I dynamically increase the size of my form, the listview inside should automatically increase in...
5
by: 2003et | last post by:
How To Create Transparent Windows Controls? Thanks
1
by: lltaylor | last post by:
Hello, Does anyone know if windows controls can interact with web controls or vice versa. For example, I would like to have a web page with a Windows Tree Control embedded, and use that...
2
by: Phillip | last post by:
In order to maintain consistency thru a project. Our development team is getting ready to start a new project in converting all the foxpro apps to VB/SQL Server. We don't have the luxury of...
0
by: poppy | last post by:
Is it possible to get 2 windows forms controls, embedded on a webpage with the <object> tags to communicate/raise events in eachother ? I know that on the client side you can set a property in a...
1
by: =?Utf-8?B?WmlnZ3lTaG9ydA==?= | last post by:
Using a Button control, I tried to reset its colour ("color" to those of you on the other side of the pond). I tried to use the BackColor attribute - but that is in System.Windows.Forms.Button....
17
by: Blau | last post by:
I'm trying to use the System.Windows.Controls namespace, but when I try to add a reference to it I don't see it in the list. I see a System.Windows.Forms, but not a System.Windows.Controls. Can...
1
by: vineetbindal | last post by:
I am using GridView in silver light application i am following some example blogg something scoutt's blog. i need to have access to my grid view in my cs file, when i type in "using...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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?
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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.