المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : how to use user control public method in the child form in the parrent form !!!



C# Programming
09-07-2009, 07:57 PM
hi . i do not good speech English. i create e window form and add e user control. in the user control is a rich text box . user control have a public method ::
public void Select_All(){
this.richtextbox1.selectall();
}
in the frmMain for is a tab control and user control add in to tabcontrol .
uercontrol1 user = (usercontrol)tabcontrol1.selectedtab.control[0];
user.Select_all();
i add a child form in the frmMain and call the Sellect_All() method of the user control . but dont work !!!