How is a method added to a control in a Windows form using C# project?
Are you preparing for IT certification? With practice questions, study notes, interactive quizzes, tips and technical articles, uCertify PrepKits ensure that you get a solid grasp of core technical concepts to ace your certification exam in first attempt.
How is a method added to a control in a Windows form using C# project?
Rating:
In a Windows form, a method is added to a control in the same way as it is added to a form or a class. In the Code window of the form, a method declaration and a method body is added within the bounds of the class declaration. A method can be added to a control in two ways. A
{
string str = MyString1 + MyString1;
MessageBox.Show(str);
}
A return type method is specified when a method returns a value. For example:
{
string str = MyString1 + MyString1;
return str;
}
Rating:
Was this information helpful?
Other articles
- What are the different techniques of adding a control to a Windows form?
- What is antialiasing?
- What is a constituent control?
- What is ClickOnce technology?
- What is the ToolStrip control?
