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

Why can't I set my form to a smaller height/width?

I have a form that I would like to make very small on load. No matter how
small I set it the form gets set to 123x34 when it loads. I am free to
resize it smaller using my mouse but the initial size is still bigger than I
have set in my code, in this case 30x20.

Am I just stuck on this?

TIA
Jun 28 '06 #1
7 2720
What is your MinimumSize property set to?
--
http://www.peterRitchie.com/
"Matthew Speed" wrote:
I have a form that I would like to make very small on load. No matter how
small I set it the form gets set to 123x34 when it loads. I am free to
resize it smaller using my mouse but the initial size is still bigger than I
have set in my code, in this case 30x20.

Am I just stuck on this?

TIA

Jun 29 '06 #2
On Wed, 28 Jun 2006 18:57:01 -0700, Peter Ritchie
<PR****@newsgroups.nospam> wrote:
What is your MinimumSize property set to?


Here is my code:

MinimumSize = new Size(30,20);
Size = new Size(30,20);

Jun 29 '06 #3
Do you call that before or after InitializeComponent()?
--
http://www.peterRitchie.com/
"Matthew Speed" wrote:
On Wed, 28 Jun 2006 18:57:01 -0700, Peter Ritchie
<PR****@newsgroups.nospam> wrote:
What is your MinimumSize property set to?


Here is my code:

MinimumSize = new Size(30,20);
Size = new Size(30,20);

Jun 29 '06 #4
On Thu, 29 Jun 2006 09:11:02 -0700, Peter Ritchie
<PR****@newsgroups.nospam> wrote:
Do you call that before or after InitializeComponent()?


After
Jun 29 '06 #5
Try setting the Bounds (rectangle) property before setting the MinimumSize
and instead of setting Size.

i.e.:
control.Bounds = new Rectangle(control.Bounds.Location , new Size(30,20));
control.MinimumSize = control.Bounds.Size;

--
http://www.peterRitchie.com/
"Matthew Speed" wrote:
On Thu, 29 Jun 2006 09:11:02 -0700, Peter Ritchie
<PR****@newsgroups.nospam> wrote:
Do you call that before or after InitializeComponent()?


After

Jun 29 '06 #6
On Thu, 29 Jun 2006 10:52:02 -0700, Peter Ritchie
<PR****@newsgroups.nospam> wrote:
Try setting the Bounds (rectangle) property before setting the MinimumSize
and instead of setting Size.

i.e.:
control.Bounds = new Rectangle(control.Bounds.Location , new Size(30,20));
control.MinimumSize = control.Bounds.Size;


This didn't work. I stepped through my code line by line and set
every place that addressed the size of the window to 30x20 and it
still won't go smaller.
Jun 29 '06 #7
On Wed, 28 Jun 2006 14:51:01 -0700, Matthew Speed
<Ma**********@discussions.microsoft.com> wrote:
I have a form that I would like to make very small on load. No matter how
small I set it the form gets set to 123x34 when it loads. I am free to
resize it smaller using my mouse but the initial size is still bigger than I
have set in my code, in this case 30x20.

Am I just stuck on this?

TIA


I've solved the problem. The issue is with the border. If I change
the border to none I can make it as small as I want.
Jun 30 '06 #8

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

Similar topics

2
by: iwasinnihon | last post by:
I don't usually like to do this, but I need help. I have gone over this code and cannot figure out why it doesn't work. First of all it doesn't check to see if you have filled in the required...
13
by: LRW | last post by:
Having a problem getting a onSubmit function to work, to where it popsup a confirmation depending on which radiobutton is selected. Here's what I have: function checkdel() { if...
7
by: x muzuo | last post by:
Hi guys, I have got a prob of javascript form validation which just doesnt work with my ASP code. Can any one help me out please. Here is the code: {////<<head> <title>IIBO Submit Page</title>...
21
by: MLH | last post by:
A97 procedure to open http://www.arch.com/message/ enter an 800 number, press "Continue", enter a text msg string from a memo field and press "Send" This is a calendaring and appointment A97...
1
by: dale zhang | last post by:
Hi, I have a web form page. it has gridlayout and a table at top like a template. When I have the literal or requiredfieldvalidator ErrorMsg displayed, they are all over the page. Is there...
2
by: VB Programmer | last post by:
I only have 1 set of <FORM> tags in my HTML file, but I keep getting this error. Any ideas? *********** A page can have only one server-side Form tag. Description: An unhandled exception...
6
by: scottyman | last post by:
I can't make this script work properly. I've gone as far as I can with it and the rest is out of my ability. I can do some html editing but I'm lost in the Java world. The script at the bottom of...
0
by: Neal | last post by:
Hi All, Help please Cross browser and W3C issues: Having major hassles trying to get my site working and looking decent in FFox (great in IE), MOzzie support said to try the W3C Validator so...
1
by: morangi | last post by:
<?php session_start(); error_reporting(E_ERROR && ~E_NOTICE && ~E_WARNING); ob_start(); $link = mysql_connect('localhost', 'root', 'test'); if (!$link) { die('Could not connect: ' ....
4
by: AAaron123 | last post by:
<body runat="server" id="MainBody"> <form id="form1" runat="server" style="background-color:green; width: 100%; height: 100%"> <br /> Table1" runat="server" Style="background-color:Yellow;...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
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
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
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...

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.