Aracılığıyla paylaş


CustomTaskPane.Height Özellik

Alır veya noktalar özel görev bölmesinin yüksekliğini ayarlar.

Ad alanı:  Microsoft.Office.Tools
Derleme:  Microsoft.Office.Tools.Common (Microsoft.Office.Tools.Common.dll içinde)

Sözdizimi

'Bildirim
Property Height As Integer
    Get
    Set
int Height { get; set; }

Özellik Değeri

Tür: System.Int32
Özel görev bölmesinde puan yüksekliği.

Özel Durumlar

Exception Koşul
COMException

Değeri DockPosition özelliği Microsoft.Office.Core.MsoCTPDockPosition.msoCTPDockPositionRight veya Microsoft.Office.Core.MsoCTPDockPosition.msoCTPDockPositionLeft ayarlamaya çalıştığınızda Height özelliği.

-veya-

Ayarlamaya çalıştığınızda Height olay işleyicisini özelliğinde DockPositionChanged veya VisibleChanged olay.

ObjectDisposedException

Dispose() Yöntemi, CustomTaskPane zaten çağrılmış.

Açıklamalar

Kullanmak istemediğiniz Height özelliği, sola veya sağa doğru belge penceresi özel görev bölmesine yerleştirildi DockPosition Özelliği Microsoft.Office.Core.MsoCTPDockPosition.msoCTPDockPositionRight veya Microsoft.Office.Core.MsoCTPDockPosition.msoCTPDockPositionLeft, Height özelliği 0 değerini döndürür ve atar bir COMException , it. ayarlamak deneyin

En fazla yükseklik dock konumuna bağlıdır. Özel görev bölmesinin üst ya da alt belge penceresinin yerleştirildiğinde, maksimum yüksekliği yaklaşık yarım ekran yüksekliğidir. Özel görev bölmesini Yüzen, en büyük bir yükseklik yoktur.

En düşük yüksekliği, birçok etmene bağlıdır ve Microsoft Office sürümlerinde ileride değiştirebilirsiniz. Ayarlamaya çalışırsanız Height özelliği en küçük yüksekliği daha küçük bir değere uygulama atama otomatik olarak Height özelliği için minimum yükseklik.

Örnekler

Aşağıdaki kod örneği, ne zaman görüntüleneceğini etkin uygulama penceresinin önüne belirtilen yüksekliği olan bir özel görev bölmesini oluşturur. Bu kod örneği için sağlanan büyük bir örnek bir parçasıdır CustomTaskPane.

Private myUserControl1 As MyUserControl
Private WithEvents myCustomTaskPane As Microsoft.Office.Tools.CustomTaskPane

Private Sub ThisAddIn_Startup(ByVal sender As Object, ByVal e As System.EventArgs) _
    Handles Me.Startup

    myUserControl1 = New MyUserControl()
    myCustomTaskPane = Me.CustomTaskPanes.Add(myUserControl1, "New Task Pane")

    With myCustomTaskPane
        .DockPosition = Office.MsoCTPDockPosition.msoCTPDockPositionFloating
        .Height = 500
        .Width = 500
        .DockPosition = Office.MsoCTPDockPosition.msoCTPDockPositionRight
        .Width = 300
        .Visible = True
    End With
End Sub
private MyUserControl myUserControl1;
private Microsoft.Office.Tools.CustomTaskPane myCustomTaskPane;

private void ThisAddIn_Startup(object sender, System.EventArgs e)
{
    myUserControl1 = new MyUserControl();
    myCustomTaskPane = this.CustomTaskPanes.Add(myUserControl1,
        "New Task Pane");

    myCustomTaskPane.DockPosition =
        Office.MsoCTPDockPosition.msoCTPDockPositionFloating;
    myCustomTaskPane.Height = 500;
    myCustomTaskPane.Width = 500;

    myCustomTaskPane.DockPosition =
        Office.MsoCTPDockPosition.msoCTPDockPositionRight;
    myCustomTaskPane.Width = 300;

    myCustomTaskPane.Visible = true;
    myCustomTaskPane.DockPositionChanged +=
        new EventHandler(myCustomTaskPane_DockPositionChanged);
}

.NET Framework Güvenliği

Ayrıca bkz.

Başvuru

CustomTaskPane Arabirim

Microsoft.Office.Tools Ad Alanı