Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //this method in the userControl
- public void Clear()
- {
- //Clear your text box
- this.txtbox1.Text = string.Empty;
- //Do other clean-up things if you want
- }
- private void button1_Click(object sender, EventArgs e)
- {
- //Call the Clear method from the UserControl
- yourUserControlName.Clear();
- }
- private void button1_Click(object sender, EventArgs e)
- {
- YourForm();
- }
- public partial class UserContoleName: UserControl{
- private static UserControleName _userControleName;
- public static UserControleName Instance{
- get{
- if(_userControleName == null){
- _userControleName = new UserControleName();
- }
- return _userControleName;
- }
- }
- public void Clear(){
- this.txtbox1.Text = string.Empty;
- }
- private void Button_click(object sender,EventArgs e)
- {
- UserControleName.Instance.Clear();
- }
Add Comment
Please, Sign In to add comment