|
|
Custom Control inside another control (user control) |
|
Author |
Message |
Brian Mains
|
Posted: Windows Forms General, Custom Control inside another control (user control) |
Top |
Hey,
For the life of me, I can't figure this out. I am adding custom controls to a user control. I have to programmatically set the height, yet the height is based on the size of the text through MeasureString. For the life of me, I can't figure out how all of this works to fit nicely. I either can't get any controls to show, or to show in the entire width of the user control correctly. It's really frustrating. Has anybody had success with this
Thanks.
Windows Forms35
|
|
|
|
|
Chris Vega
|
Posted: Windows Forms General, Custom Control inside another control (user control) |
Top |
I'm not sure I understand your situation., correct me if I'm wrong, do you want the container (user control) of your control to adjust based on the content (text) of the child control
Getting the height of text is equivalent in getting the height of the Font. You only need MeasureString if you are calculating the width or the bound the text needs (in case of wrapping).
Please tell us more what do you want to achieve, so we can help you.
Cheers,
-chris
|
|
|
|
|
|
|