container-like behavior
-
When you use a panel in the designer, you can drag&drop controls in it and they are contained by the panel and not the form containing the panel. Does anyone know the secret behind this kind of behaviour?
-
When you use a panel in the designer, you can drag&drop controls in it and they are contained by the panel and not the form containing the panel. Does anyone know the secret behind this kind of behaviour?
Erhm, i don't know what you mean with your question.... 'The secret about this behaviour??' What exactly do you want us to explain??
.: I love it when a plan comes together :. http://www.zonderpunt.nl
-
Erhm, i don't know what you mean with your question.... 'The secret about this behaviour??' What exactly do you want us to explain??
.: I love it when a plan comes together :. http://www.zonderpunt.nl
I'd like to know I can create my own user control that acts like a panel control. What I mean is that when I place my user control on a form and drag say a picture box from the toolbox over it, it has to behave like a panel control would - if I set the Dock property of the PictureBox to Fill, the PictureBox should fill my control and not the form.
-
When you use a panel in the designer, you can drag&drop controls in it and they are contained by the panel and not the form containing the panel. Does anyone know the secret behind this kind of behaviour?
To make your own container control, you can inherit it from
Control
class -or any class inheriting from it likeUserControl
for example-, and handle theControlAdded
event.Regards:rose:
-
I'd like to know I can create my own user control that acts like a panel control. What I mean is that when I place my user control on a form and drag say a picture box from the toolbox over it, it has to behave like a panel control would - if I set the Dock property of the PictureBox to Fill, the PictureBox should fill my control and not the form.