Controls inside a user control resize automatically RRS feed

  • Question

  • I have a simple custom control (named ctrl1) with 2 panels docked one on the left and the other one as fill. I add another control (for example a list view) to ctrl1, and it looks ok on the designer (I do not dock the list view). However when I run the app, I notice all my controls inside ctrl1 get somehow resized horizontally only (made wider). If I add a picture box, the picture image appears wider when compared to the design time view. I don't expect this as I am not docking the added controls in any way.

    I did change the default font for the main form to Verdana. So if this creates the resize, how can I make the designer and the runtime to show the same?

    Is this some control/form settings I am not aware of?

    I am using C# VS 2005.


    Monday, July 10, 2006 10:26 PM


  • The problem is that the parent control and the added control must have the same font; or the font scaling causes the runtime view of the control to be different.
    Monday, July 10, 2006 11:04 PM