hi
how can I replace if with swtich .
protected void testSwitch( object myObject)
{
if (myObject.GetType() == typeof(Button))
{
Button btnMyObj = (Button)myObject;
btnMyObj.Visible = true;
}
switch (myObject)
{
case myObject.GetType() == typeof(Button):
//...
break;
default:
//...
break;
}
}
Jaimin ShethiyaPosted Apr 27, 2020, 10:30 PM
can you please try to below code.
let me know if you have any doubt.
Thanks.
Jignesh KumarPosted Apr 27, 2020, 9:15 AM
Rajanikant HawaldarPosted Apr 27, 2020, 9:03 AM