By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,728 Members | 2,462 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,728 IT Pros & Developers. It's quick & easy.

problem in setting the width of a form to 20

P: n/a
Hi !

I am facing a wierd problem in setting the width of a form to 20.

Suppose I create two forms Form1 and Form2.

Form1 is the container, meaning
this.IsMdiContainer = true;

Form2 is child form meaning,
f = new Form2();
f.Location = new Point(200,200);
f.MdiParent = this; //Form1 is the parent
f.Show();

I set the width of my Form2 to 20. Yet when it is displayed on Form1, its
width is much larger, way beyond 100. I checked all the properties for Form2
yet I am not able to get the Form2 of thinner width. FormBorderStyle of
Form2 is none. Is there any trick or am I not setting some property?

Regards,
Paresh.


Nov 15 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Paresh,

Are you able to manually size the form to a width of 20? You can easly test this by placing a textbox on the form which is set in the Size event to the current width. I think there is a minimum that you can set the width and the height of forms to, and you could be trying to exceed that width.

Hope this helps.

-Nicholas Paldino [.NET/C# MVP]

On Fri, 26 Sep 2003 12:44:13 +0100, Paresh Dhakan <pd*****@meritsolutions.ie> wrote:
Hi !

I am facing a wierd problem in setting the width of a form to 20.

Suppose I create two forms Form1 and Form2.

Form1 is the container, meaning
this.IsMdiContainer = true;

Form2 is child form meaning,
f = new Form2();
f.Location = new Point(200,200);
f.MdiParent = this; //Form1 is the parent
f.Show();

I set the width of my Form2 to 20. Yet when it is displayed on Form1, its
width is much larger, way beyond 100. I checked all the properties for Form2
yet I am not able to get the Form2 of thinner width. FormBorderStyle of
Form2 is none. Is there any trick or am I not setting some property?

Regards,
Paresh.


Nov 15 '05 #2

P: n/a
You can set size to 20 if you set borderstyle to none or toolwindow(fixed
or sizable). Otherwise minimum size seems to be 123.

There might be some way to override the form to set regular windows to
smaller sizes.

--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
Nov 15 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.