I am bringing a few user controls to my c# winform and I am basically doing the same thing again and again. Every time I click a button on the main form and one of the user controls is visible it calls a property of that user control to occur and if a different user control is visible it calls a different property of a that user control to occur since basically the same code is happening by the button click regardless of which user control is visible I would like to save code space and make a subroutine that essentially does the same thing it just uses a different user control and user control property per user control and I would like to have a parameter of the subroutine something like this
private void DoSomething(UserControl usercontrol, UserControlProperty property)
{
usercontrol.property
}
DoSomething(Products, Products.Fill);
Debra has a question