Windows Develop Bookmark and Share   
 index > Windows Forms Designer > User Control resizes when placed on form (VS 2005)
 

User Control resizes when placed on form (VS 2005)

My user control has a text box 292 pixels wide, whenplacedon a form it grows to 344.

Is this a bug or is therea way to prevent this.

I'm using VS 2005

Thanks

Jeff

Jeff1  Wednesday, October 04, 2006 3:58 AM

When you create your usercontrol

For the textbox
1)set location of the text box to 0,0
2)set the margins of the text box to 0

for the usercontrol,
1)set autosize to true
2)autosizemode = grow and shrink
3)margins to 0

then the size of the textbox is equal to the size of usercontrol

you build your project
when you now place your user control on the form, you should see the size of the textbox is the same

Naga Satish Rupenaguntla  Friday, October 13, 2006 8:10 PM

You can use google to search for other answers

Custom Search

More Threads

• how to set a format for date
• How I Make a form a Resolution Independent Form?
• HELP ME!!!!!!
• Protected Members and Designer
• How to assign the value in comboBox that in DataGridView Control?
• VB.NET and MySQL
• Is there anyway to set the width of a textbox according to its maxlength property???
• How to host a WebControl in my custom designer
• Icons for nodes in a Treeview
• Implementing ISerializable and IBindableComponent for Design-Time Component?