Button.Border الخاصية
يحصل Borderالذي يمثل الحدود Button.
مساحة الاسم: Microsoft.Office.Tools.Excel.Controls
التجميع: Microsoft.Office.Tools.Excel.v4.0.Utilities (في Microsoft.Office.Tools.Excel.v4.0.Utilities.dll)
بناء الجملة
'إقرار
Public ReadOnly Property Border As Border
Get
public Border Border { get; }
قيمة الخاصية
النوع: Microsoft.Office.Interop.Excel.Border
Borderالذي يمثل الحدود Button.
أمثلة
ما يلي تعليمات برمجية في المثال إضافة Buttonعنصر التحكم إلى ورقة عمل ويستخدم Borderخاصية إلى اللون حد أخضر خلية. Clickمعالج حدث من زر يستخدم Visibleخاصية لإخفاء زر، وثم بمطالبة مستخدم باختيار أما إظهار زر، أو السماح بتبقي مخفية.
Th هو المثال هو لتخصيص المستوى مستند.
Private Sub AlterControlAppearance()
Dim HideButton As Microsoft.Office.Tools.Excel.Controls.Button = _
Me.Controls.AddButton(Me.Range("B2", "C3"), "HideButton")
HideButton.Text = "Click to hide"
HideButton.Border.Color = ColorTranslator.ToOle(Color.Green)
AddHandler HideButton.Click, AddressOf hideButton_Click
End Sub
Private Sub HideButton_Click(ByVal sender As Object, ByVal e As EventArgs)
Dim ClickedButton As Microsoft.Office.Tools.Excel.Controls.Button = _
CType(sender, Microsoft.Office.Tools.Excel.Controls.Button)
ClickedButton.Visible = False
' Allow the user to make the button visible.
If DialogResult.Yes = MessageBox.Show( _
"This sheet contains a hidden control." & _
" Make it visible?", "Example", MessageBoxButtons.YesNo) Then
ClickedButton.Visible = True
End If
End Sub
private void AlterControlAppearance()
{
Microsoft.Office.Tools.Excel.Controls.Button hideButton =
this.Controls.AddButton(this.Range["B2", "C3"],
"hideButton");
hideButton.Text = "Click to hide";
hideButton.Border.Color = ColorTranslator.ToOle(Color.Green);
hideButton.Click += new EventHandler(hideButton_Click);
}
void hideButton_Click(object sender, EventArgs e)
{
Microsoft.Office.Tools.Excel.Controls.Button clickedButton =
(Microsoft.Office.Tools.Excel.Controls.Button)sender;
clickedButton.Visible = false;
// Allow the user to make the button visible.
if (DialogResult.Yes ==
MessageBox.Show("This sheet contains a hidden control." +
" Make it visible?", "Example", MessageBoxButtons.YesNo))
{
clickedButton.Visible = true;
}
}
أمن NET Framework.
- الثقة الكاملة للمتصل الفوري. يتعذر استخدام هذا العضو بواسطة التعليمات البرمجية الموثوق بها جزئيًا. لمزيد من المعلومات، راجع باستخدام مكتبات من تعليمات برمجية موثوق بها جزئي.