form maximization

swapnil

Member
Joined
Nov 25, 2008
Messages
9
Programming Experience
Beginner
hi

i want a help

i want my form to open in maximize when i click on exe file and i also want to disable the maximize/minimize button b'cos i don't want my user to change the form size .....


another problem is Form size it is different for different computer
tell me how can i fix size of my form for any computer


can anyone tell me how i can do it....
 
Last edited:
Your question doesn't make much sense from the point of view that first you say that you want the form maximised and then you say that you want it the same size on every system. You can't have it both ways. You can easily maximise the form but then it will be whatever size the screen is. You can easily fix the size of the form but then you can't have it maximised. You need to choose one or the other.

To remove the Minimize and Maximize buttons from the form's title bar you need to set the MinimizeBox and MaximizeBox properties to False. To make the form maximised you need to set the WindowState to Maximized.

To prevent the user resizing the form if its WindowState is Normal you set the MinimumSize and MaximumSize properties to the same value as the Size property.

Note that all these changes can be made in the Properties window at design time, so you really didn't look for the answer very hard yourself. If you want to do something to a component then you should have a thorough look through the Properties window first, then read the class documentation. If you can't find what you want, then you should consider looking elsewhere.
 
Your question doesn't make much sense from the point of view that first you say that you want the form maximised and then you say that you want it the same size on every system. You can't have it both ways. You can easily maximise the form but then it will be whatever size the screen is. You can easily fix the size of the form but then you can't have it maximised. You need to choose one or the other.

To remove the Minimize and Maximize buttons from the form's title bar you need to set the MinimizeBox and MaximizeBox properties to False. To make the form maximised you need to set the WindowState to Maximized.

To prevent the user resizing the form if its WindowState is Normal you set the MinimumSize and MaximumSize properties to the same value as the Size property.

Note that all these changes can be made in the Properties window at design time, so you really didn't look for the answer very hard yourself. If you want to do something to a component then you should have a thorough look through the Properties window first, then read the class documentation. If you can't find what you want, then you should consider looking elsewhere.


thanks for reply

yes you are right

i got solution for my first problem

but the main problem is resolution problem of monitors

how can i handle this. what can i do to look my form same even if computer change..
 
That depends on exactly what you want to do and why. I've got a 24" wide-screen monitor at home and I don't want forms with enormous text and the like. What exactly are you trying to achieve?
 
That depends on exactly what you want to do and why. I've got a 24" wide-screen monitor at home and I don't want forms with enormous text and the like. What exactly are you trying to achieve?


I have developed my application on computer whose resolution is 1280 * 720 (32bit)

now when i run the application on 1024 * 768 (32 bit)
its look like this :-




i don't know exactly on what resolution monitor my application is going to work
so i want my application to work on all monitor with proper size

now u got my point
forget about maximize the form and all that i got solution for that
what i want is explain above
 
I've just recently gone through something similar... I worked around the resolution bit by playing with the anchors for the bits on the form and that seems to have some what taken care of the resolution issue... (they use everything from 800x600 to 1680x1050)... I just adjusted my resolution when ever I ran the debug... pain in the butt I know but at least I knew that everything was gonna fit... the other issue that I ran in to (sorry for the rant here) is that most of the users are damn near blind, they've set their windows fonts to some ridiculous sizes... (if you don't know what I'm talking about Display Properties > Appearance (tab) > Advanced (Button) and check out the "Items" combobox) they've got stuff like their "Active Title Bar" up to (Size 44) and font (22)... the sucky part is that every user in that dept. has something different... In the end I gave up and sized everything to be as correct as possible in an 800x600 standard environment...

Good luck to you...
 
As thirteentwenty says, the Anchor property is the first thing you need to look at. Run the attached project and grab the lower right-hand corner of the form. Drag it around and see how the controls behave. Now take a look at the Anchor property of each control to see how that's achieved.

Now, from your screenshot I have an inkling that you may be try to keep some of your controls centred, although it's not clear. That's why I asked you to explain EXACTLY what you're trying to achieve, but, of course, noone wants to take the time to provide a full and clear explanation. If what you've been provided with so far doesn't solve your problem then that's what you're going to have to do. A screen shot of the form looking wrong doesn't actually tell what is right, so all we can do is guess.
 

Attachments

  • WindowsApplication1.zip
    14 KB · Views: 43
Back
Top