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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Nilanka DharmadasaRank #1,875 · 794 reputationPosted Nov 20, 2009, 2:46 AM EST
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.
Hoang Tran4 reputationPosted Nov 21, 2009, 2:07 PM EST
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?