473,732 Members | 2,217 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 15045
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.FormBord erStyle = FormBorderStyle .Fixed3D;

ok,
aq
"Chris" <An*****@work.n l> 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**********@g mail.com> wrote in message
news:Oh******** ******@TK2MSFTN GP15.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.FormBord erStyle = FormBorderStyle .Fixed3D;

ok,
aq
"Chris" <An*****@work.n l> 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.n l> 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.n l> 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.n l> 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
1004
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. Thanks John
2
3958
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 size ). Thanks.
5
6670
by: 2003et | last post by:
How To Create Transparent Windows Controls? Thanks
1
1211
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 windows control to navigate around the web application and interact with other web controls. I know there is a web tree control available, however I was just
2
1179
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 training so hopefully our F1 training won't cause us any major problems or future headaches. Are there any guides out there that might have the basic fundementals of a windows application.
0
963
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 windows control but I need multiple windows controls to communicate and raise events. I am not even sure if they can be made aware of eachother.
1
5932
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. When I add "using System.Windows.Forms" I get an ambiguous usage error, seeing as I am also "using System.Windows.Controls". I thought it would be hoping too much to cast from System.Windows.Controls.Button to System.Windows.Controls.Button or...
17
20369
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 someone let me know how I go about getting it in the list of available references? Thanks
1
2838
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 System.Windows.Controls.Data;" it gives me error the type or namespace name Data does not exist in the name space System.Windows.Controls.Data... I have added this dll in the referance but visual studio is not able to see it? please help me.
0
8774
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9307
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9235
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8186
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6735
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6031
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4550
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3261
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2180
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.