مشاركة عبر


Button.OLEType الخاصية

يحصل على القيمة تمثل OLE نوع الكائنات.

مساحة الاسم:  Microsoft.Office.Tools.Excel.Controls
التجميع:  Microsoft.Office.Tools.Excel.v4.0.Utilities (في Microsoft.Office.Tools.Excel.v4.0.Utilities.dll)

بناء الجملة

'إقرار
Public ReadOnly Property OLEType As Object
    Get
public Object OLEType { get; }

قيمة الخاصية

النوع: System.Object
AnxlOLEControl.

أمثلة

مثال التعليمة البرمجية التالية ينشئ Buttonعنصر التحكم وتعيين زر النص إلى سلسلة التي تصف نوع كائن OLE زر، كما يفرضها OLETypeالقيمة خاصية.

Th هو المثال هو لتخصيص المستوى مستند.

Private Sub DisplayOLEType()
    Dim OleButton As Microsoft.Office.Tools.Excel.Controls.Button = _
        Me.Controls.AddButton(Me.Range("B2", "C3"), "OleButton1")

    Dim ControlType As String
    Select Case OleButton.OLEType
        Case Excel.XlOLEType.xlOLEControl
            ControlType = "OLE control"

        Case Excel.XlOLEType.xlOLEEmbed
            ControlType = "OLE embedded control"

        Case Excel.XlOLEType.xlOLELink
            ControlType = "OLE linked control"

        Case Else
            ControlType = "Not assigned an OLE type"
    End Select
    oleButton.Text = controlType
End Sub
private void DisplayOLEType()
{
    Microsoft.Office.Tools.Excel.Controls.Button oleButton =
            this.Controls.AddButton(this.Range["B2", "C3"],
            "oleButton1");

    string controlType;
    switch ((int)oleButton.OLEType)
    {
        case (int)Excel.XlOLEType.xlOLEControl:
            controlType = "OLE control";
            break;

        case (int)Excel.XlOLEType.xlOLEEmbed:
            controlType = "OLE embedded control";
            break;

        case (int)Excel.XlOLEType.xlOLELink:
            controlType = "OLE linked control";
            break;

        default:
            controlType = "Not assigned an OLE type";
            break;
    }
    oleButton.Text = controlType;
}

أمن NET Framework.

راجع أيضًَا

المرجع

Button الفئة

Button الأعضاء

Microsoft.Office.Tools.Excel.Controls مساحة الاسم