C
CCLeasing
Here is my code
private void updateticks(TextBox textbox, CheckBox tickbox)
{
if (textbox.Text.Length > 0)
{
tickbox.Visible = true;
}
else
{
tickbox.Visible = false;
}
}
private void updateticks(ComboBox combox, CheckBox tickbox)
{
if (combox.Text.Length > 0)
{
tickbox.Visible = true;
}
else
{
tickbox.Visible = false;
}
}
-
It works and i can send either a textbox control, or a combobox control
as the first argument. But written like this they look like two
different functions, is there another way of writing to the above to
make it more obvious that they are the same function just overloaded?
private void updateticks(TextBox textbox, CheckBox tickbox)
{
if (textbox.Text.Length > 0)
{
tickbox.Visible = true;
}
else
{
tickbox.Visible = false;
}
}
private void updateticks(ComboBox combox, CheckBox tickbox)
{
if (combox.Text.Length > 0)
{
tickbox.Visible = true;
}
else
{
tickbox.Visible = false;
}
}
-
It works and i can send either a textbox control, or a combobox control
as the first argument. But written like this they look like two
different functions, is there another way of writing to the above to
make it more obvious that they are the same function just overloaded?