Here is the app with the e-clock custom control
And here is when I enlarge the form
Any tip or solution for this problem?Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Hoang TranPosted Nov 21, 2009, 7:07 PM
thanks for answer quickly. But I make a straight Window Control Library project, so my control derived from class UserControl. When I use it on the Form, I see that it already has Anchor and Dock properties. The above image display the control set anchor to Top, Left, Right, Bottom. When I enlarge the form containing the custom control, it also enlarge(that's what I want), overlap other control(that's what I don't expect), even when I set those button to anchor, too. If I don't set anchor for the custom control, it just simply go to the center of the form when I enlarge my form. The admin send me some articles about custom control and I think I should deal with the Resize event. But the one I need now is some explanation about the behavior of the control. Why the buttons don't detect that the eclock control has change it size and move according to the change, just like an normal control do when setting anchor? Is there any book saying deeply about it?
Nilanka DharmadasaPosted Nov 20, 2009, 7:46 AM
When you create the cusotm control, do you use a panel or some other container? Define a public property to set anchor of the container in custom control.
Then try to set it from the form where you use the control.