Override a method in a custom control.
-
I've write a button base class. In the click even't i put code below: this.Enabled = false; this.Clicked(); //is a public virtual method in the class. this.Enabled = true; So next time when i when i use the button control i just need to put all my code in the Clicked() method in the custom button control. But the proplem is how do i put the in the Clicked() method ? In VFP i just need to override the Clicked() method with mu on code. But in C# it seen like quit confusing for me. Please advice. Thanks. Below is the complete class code.
public class stdTextBox:System.Windows.Forms.Button { protected override void OnClick(EventArgs e) { this.Enabled = false; this.clicked(); this.Enabled = true; } private void clicked() { } }
-
I've write a button base class. In the click even't i put code below: this.Enabled = false; this.Clicked(); //is a public virtual method in the class. this.Enabled = true; So next time when i when i use the button control i just need to put all my code in the Clicked() method in the custom button control. But the proplem is how do i put the in the Clicked() method ? In VFP i just need to override the Clicked() method with mu on code. But in C# it seen like quit confusing for me. Please advice. Thanks. Below is the complete class code.
public class stdTextBox:System.Windows.Forms.Button { protected override void OnClick(EventArgs e) { this.Enabled = false; this.clicked(); this.Enabled = true; } private void clicked() { } }
-