BaseTaskForm.SetButtonsPanel(Control) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Adds a button to the button panel.
protected:
void SetButtonsPanel(System::Windows::Forms::Control ^ buttons);
protected void SetButtonsPanel (System.Windows.Forms.Control buttons);
member this.SetButtonsPanel : System.Windows.Forms.Control -> unit
Protected Sub SetButtonsPanel (buttons As Control)
Parameters
Exceptions
buttons
is null
.
This method has been previously called.
Examples
The following example adds two buttons to a ManagementPanel object and then uses the SetButtonsPanel method to set the button panel.
void SetButtonsControl() {
_buttonsPanel = new ManagementPanel();
_buttonsPanel.SuspendLayout();
try {
int x = ClientSize.Width - 11 - _cancelBtn.Width;
int y = 0;
int tabIndex = 1638;
AnchorStyles anchorStyle = AnchorStyles.Bottom | AnchorStyles.Right;
// Add the Cancel button
_cancelBtn.Location = new Point(x, y);
_cancelBtn.Anchor = anchorStyle;
_cancelBtn.TabIndex = tabIndex++;
_buttonsPanel.Controls.Add(_cancelBtn);
x -= _installBtn.Width;
x -= 6;
// Add the Install button
_installBtn.Location = new Point(x, y);
_installBtn.Anchor = anchorStyle;
_installBtn.TabIndex = tabIndex++;
_buttonsPanel.Controls.Add(_installBtn);
_buttonsPanel.Size = new Size(ClientSize.Width,
11 + 22);
} finally {
_buttonsPanel.ResumeLayout(false);
SetButtonsPanel(_buttonsPanel);
}
}