B
Boki
Hi All,
We can assign multi object ( ex: textbox )'s double click point to a
same function. ex:
private void all_boki_textbox_point_here_DoubleClick(object sender,
EventArgs e)
{
...
...
}
If I have many objects, they are totally doing the same thing, ex:
copy textboxN's text to a specify textbox.
my code become:
private void all_boki_textbox_point_here_DoubleClick(object sender,
EventArgs e)
{
if (sender == textbox1)
final_text_box.text=textbox1.text;
if (sender == textbox2)
final_text_box.text=textbox2.text;
....
}
How to write code as only one line ?
Thanks!
Best regards,
Boki.
We can assign multi object ( ex: textbox )'s double click point to a
same function. ex:
private void all_boki_textbox_point_here_DoubleClick(object sender,
EventArgs e)
{
...
...
}
If I have many objects, they are totally doing the same thing, ex:
copy textboxN's text to a specify textbox.
my code become:
private void all_boki_textbox_point_here_DoubleClick(object sender,
EventArgs e)
{
if (sender == textbox1)
final_text_box.text=textbox1.text;
if (sender == textbox2)
final_text_box.text=textbox2.text;
....
}
How to write code as only one line ?
Thanks!
Best regards,
Boki.