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.

VulpesPosted Jun 15, 2011, 11:35 AM
Vijay YadavPosted Jun 17, 2011, 12:37 AM
Thanks a lot for reminiding me. And Vulpes i'm sorry for this.
Sam HobbsPosted Jun 16, 2011, 9:05 PM
Vijay YadavPosted Jun 16, 2011, 1:43 AM
Thanks a lot!!! Now it is working fine.