DekGenius.com
[ Team LiB ] Previous Section Next Section

IButtonControl

System.Windows.Forms (system.windows.forms.dll)interface

This interface is implemented by Control objects such as Button and LinkLabel, which provide button-like behavior.

The framework requires the PerformClick() method to provide a way of programmatically clicking the button.

NotifyDefault() is called by the framework when the button becomes the default (i.e., when it is set as the active Form object's AcceptButton).

Finally, DialogResult is the property you should implement to maintain the result code that will be set if the button is clicked to terminate a Form that has been shown modally with the ShowDialog() method.

public interface IButtonControl {
// Public Instance Properties
   public DialogResult DialogResult{set; get; }
// Public Instance Methods
   public void NotifyDefault(bool value);
   public void PerformClick();
}

Implemented By

Button, LinkLabel

Returned By

Form.{AcceptButton, CancelButton}, PrintPreviewDialog.{AcceptButton, CancelButton}

Passed To

Form.{AcceptButton, CancelButton}, PrintPreviewDialog.{AcceptButton, CancelButton}

    [ Team LiB ] Previous Section Next Section