I want to pass the control to the class as a parameter
for ex:
in class file, i have the below function:
public void DisableMouseRightClick(Control objControl)
{
var blankContextMenu = new ContextMenu();
foreach (Control control in objControl.Controls)
{
control.ContextMenu = blankContextMenu;
}
}
on form load, i have this:
foreach (Control ctl in this.Controls)
{
if (ctl is TextBox)
{
classFileObject.DisableMouseRightClick(ctl);
}
}
but it is not working.


VulpesRank #55 · 29.2K reputationPosted Jun 15, 2011, 7:35 AM EDT
Vijay YadavRank #1,637 · 943 reputationPosted Jun 15, 2011, 9:43 PM EDT
Thanks a lot!!! Now it is working fine.
Sam HobbsRank #107 · 20.5K reputationPosted Jun 16, 2011, 5:05 PM EDT
Vijay YadavRank #1,637 · 943 reputationPosted Jun 16, 2011, 8:37 PM EDT
Thanks a lot for reminiding me. And Vulpes i'm sorry for this.