i have make user control and inside that user control takes two buttons name dock and close respectively .
now i want to dock my user control to left when i clicks button dock and close my user control when i clicks button close..
now it works fine…..
but when i add my usercontrol to the toolbox by taking choose items….
then drag and drop my user control to form…
now i have chk on form move event if user control is dock or not…
(i am trying to use by making object of user control but doesnt helps…..)
private void Form1_MouseMove(object sender, MouseEventArgs e)
{
Container_User_Control.Container1 obj = new Container_User_Control.Container1();
if (obj.Dock != DockStyle.Left)
{
obj.visible=false;
}
else
{
obj.visible=true;
}
}
Thanks in advanced….
I have no idea why you are using a Mouse_Move event but if I understood your question right then:
When you drag your UserControl from the toolbox to the form, an instance of the usercontrol is created in the form designer code. Something like Container_User_Control1, so instead of using:
use: