简体   繁体   中英

C#: custom control vs native control

ALL, I am trying to develop a C# Windows Forms application. For that I needed to make a custom control that is derived from the GroupBox.

Now for the problem. I have a form and on the form I put a grid box. On 1 cell I put a GroupBox and on another cell I put my custom control. For both controls properties I put "ColumnSpan" to be 3 as grid has 3 columns. The native control display itself properly, meaning it is stretched. The custom control display itself incorrectly, meaning it is not stretched.

I checked and all properties in the properties inspector are the same.

What am I missing?

Thank you.

For some reason custom controls do not resize themselves. So all I had to do in the GUI designer is to resize the control.

Thank you for reading and hopefully it will help someone else.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM