Answer the question
In order to leave comments, you need to log in
What (probably reference data type) for the TextBox?
I know that there are standard data types such as int , char , long , decimal and so on and so forth... They all belong to System , there are more reference types object , string , I can convert from object to int for example. But there is also in winforms , for example, the type (or whatever it is called) TextBox , Button , Label ... Which (probably more reference type) from which I can convert not to int , but to TextBox or Label. On the example of the starting point, which is of no interest to anyone.
private void textBox1_MouseMove(object sender, MouseEventArgs e)
{
textBox1 = (TextBox)sender;
}
private void move(Control control , object sender)
{
control obj = (control)sender;
}
Answer the question
In order to leave comments, you need to log in
TextBox, Button, Label are all visual components. These are the same classes + visual component (by the way, you can do it yourself). What you are trying to do is called type casting.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question