I'm a newbie working on a program in C# .Net 2003 I'm trying to resize my user controls to populate them on another form. I've already coded a program in .Net 2005 in it I used auto size my user control through the properties window... 2003 doesn't have that as an option so I'm trying to figure out how to do it programatically (problematically whatever). I thought I could do it with:

System.Windows.Forms.Form.ActiveForm.Size = new System.Drawing.Size(496,(maxLenLine*22)+ 56);

or something like that???

Anyone have any word of advice or am I way off base?

Thanks

Recommended Answers

All 2 Replies

userControl1.Height = X;
userControl1.Width = Y;

Thanks for the reply... found out that I was over complicating it...I hate that. It was just:

this.Height = someControlHeight

SO thanks but I got it.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.