NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

Button Constructor

Initializes a new instance of the Button class.

[Visual Basic]
Public Sub New()
[C#]
public Button();
[C++]
public: Button();
[JScript]
public function Button();

Remarks

By default the Button displays no caption. To specify the caption text, set the Text property.

Example [Visual Basic]

The following example instantiates a Button and sets its DialogResult property to DialogResult.Ok.

[Visual Basic]

' Instantiate a Button.
Private Button1 As System.WinForms.Button
Private MySub()
   ' Initialize a new Button.
   Form1.Button1 = New System.WinForms.Button
 
  ' Set the button to return a value of Ok when clicked.
   Button1.DialogResult = DialogResult.Ok

   ' Add the button to the form.
   Form1.Controls.Add(Button1)
End Sub

See Also

Button Class | Button Members | System.WinForms Namespace | Button