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

Form positioning when maximized

Hello.
IŽve got a form which maximum size is 300x300 pixels.
It can be resized and maximized. The problem:

If the user sets the window state to maximized, the forms location
is set to 0,0. Changing the Location property doesnŽt help.

Is it possible to center it on the screen even if maximized?
And if yes, how is it done?

Thanks for any ideas,
timtos.
Nov 15 '05 #1
4 3361
But if the user makes the form smaller it would be nice if he
can push the maximize button to get it back to 300x300 pixels
- and have it again centered on the screen.

Of course I can create my own button which does the job
but I think it is more intuitive to use the windows-style...

But anyway - thanks for answering!
Greetings, timtos.

"Goran Genter" <ge***@fly.srk.fer.hr> wrote in message news:bi**********@bagan.srce.hr...
"timtos" <ti****@gmx.de> wrote in message
news:bi**********@news.uni-koblenz.de
Hello.
IŽve got a form which maximum size is 300x300 pixels.
It can be resized and maximized. The problem:

If the user sets the window state to maximized, the forms location
is set to 0,0. Changing the Location property doesnŽt help.

Is it possible to center it on the screen even if maximized?
And if yes, how is it done?


Would't it be easier to disable Maximize button? It doesn't make sense
anyway if you have MaximumSize set.

Nov 15 '05 #2
"timtos" <ti****@gmx.de> wrote in message
news:bi***********@news.uni-koblenz.de
But if the user makes the form smaller it would be nice if he
can push the maximize button to get it back to 300x300 pixels
- and have it again centered on the screen.


Then why is window sizeable when you are limiting its Max size.
Set fixed window, and you have no problems.
Nov 15 '05 #3
"timtos" <ti****@gmx.de> wrote in message
news:bi***********@news.uni-koblenz.de...
But if the user makes the form smaller it would be nice if he
can push the maximize button to get it back to 300x300 pixels
- and have it again centered on the screen.

Of course I can create my own button which does the job
but I think it is more intuitive to use the windows-style...


I don't know if that's more intuitive or not. Generally, that button means
"maximize this window so it fills the screen" and I can't think of the last
time I saw that button do anything other than that. And how do you know the
user wants the location to be the middle of the screen? They might want it
at full size (300x300), but in the lower right corner of the screen.

I guess I'm not a big fan of "maximum size" to begin with - can't think of
any problems it solves (in contrast to minimum size which is very nice to
keep controls from overlapping each other). I'd either go with a fixed size
form, or else let the user size it however they want, and let them put it
where they want. That's most consistent with windows behavior.

I suppose you can watch the Resize event, check for WindowState = Maximized,
and then programmaticly unmaximize and set the location, but I think that
will end up causing about 10 other problems, especially when they try to
"unmaximize".
--
Mike Mayer
http://www.mag37.com/csharp/
mi**@mag37.com
Nov 15 '05 #4
Ok.
IŽll think over it again.
Thanks everyone for the help!

Greetings, timtos.

"timtos" <ti****@gmx.de> wrote in message news:bi**********@news.uni-koblenz.de...
Hello.
IŽve got a form which maximum size is 300x300 pixels.
It can be resized and maximized. The problem:

If the user sets the window state to maximized, the forms location
is set to 0,0. Changing the Location property doesnŽt help.

Is it possible to center it on the screen even if maximized?
And if yes, how is it done?

Thanks for any ideas,
timtos.

Nov 15 '05 #5

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

Similar topics

1
by: alex | last post by:
How to hide the form window when it's minimized? Please help.
0
by: whatchu | last post by:
VS .NET 2003 Is it possible to get a form's FormWindowState.Normal coordinates that Windows has saved, WHILE the form is Maximized? i.e. click the restore box on a maximized form, and it goes...
2
by: Jerry Spence1 | last post by:
I'm having a problem with the following excerpt: dim tcpCli As New TcpClient Dim ns As NetworkStream = tcpCli.GetStream Dim sw As New StreamWriter(ns, System.Text.Encoding.Default) Dim sr...
2
by: Bill Stillwell | last post by:
I am trying to set the "backcolor" property in fields in a form. It sets okay using a macro (setvalue). But when I close the form, the property settings revert back to what they were before I...
7
by: =?Utf-8?B?bGpsZXZlbmQy?= | last post by:
I've noticed that a form will cover the taskbar when it is maximized if its ControlBox property is set to false (even if the "Keep the taskbar on top of other windows" option is selected). You can...
5
by: cmartin1986 | last post by:
Hi Guys, My problem today is how to change the labels in a form header when the user selects a different tab. I want it in the header instead of the tab control box because im using this is a...
1
Mague
by: Mague | last post by:
Hello, First of all thanks for trying to help. My problem is in vb.net 2008 (it's pritty much the same as 2005) when a vb program is maximized it just makes the background bigger and everything...
2
by: bkendra5 | last post by:
How can I open a form say from the switchboard, to be maximized upon open.
2
by: Kelly R | last post by:
I want my startup form to be maximized when I open the database but then I want the forms and reports that I open to not be maximized. How do I keep the main form maximized and customize my other...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
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...

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.