I have made one function named SetControls(control controlName) which only takes control as a argument.And I want to pass the toolstripbutton which is in the tooltipcontainer.Function SetControls() consider toolstripContainer but does not consider toolstripbutton as control and there is error if I pass the toolstripbutton as control.
Then what should I do ? Shoud I convert the toolstripbutton as control, if yes then how??
The problem you are having is because ToolStripButton inherits from Component and not Control. The standard System.Windows.Forms.Button inherits from Control which in turn inherits from Component. You would have to change SetControls from:
to
if you want to use the method to handle both standard controls and ToolStripButton’s.