'宣言 Public Function AddDocument( _ ByVal header As Object, _ ByVal content As Object _ ) As ContentPane
public ContentPane AddDocument( object header, object content )
例外 | 解説 |
---|---|
System.InvalidOperationException | Content プロパティは、DocumentContentHost に設定されなければなりません。 |
Imports Infragistics.Windows.DockManager ' this sample assumes you have a XamDockManager whose Content ' is set to a DocumentContentHost. calling AddDocument when ' the dockmanager is not using a DocumentContentHost will ' result in an exception Private Sub btnAddDocument_Click(ByVal sender As Object, ByVal e As RoutedEventArgs) Dim header As Object = "New File" Dim content As Object = New RichTextBox() ' the AddDocument method will create a new ContentPane for ' the given header & content and put that content pane in ' the tabgrouppane containing the active pane or a new ' tabgrouppane if there aren't any available Dim newDocument As ContentPane = Me.dmForAddDocument.AddDocument(header, content) newDocument.AllowDocking = False newDocument.AllowFloatingOnly = False ' the adddocument method doesn't automatically activate the pane ' in case you wanted to add multiple panes newDocument.Activate() End Sub
using Infragistics.Windows.DockManager; // this sample assumes you have a XamDockManager whose Content // is set to a DocumentContentHost. calling AddDocument when // the dockmanager is not using a DocumentContentHost will // result in an exception private void btnAddDocument_Click(object sender, RoutedEventArgs e) { object header = "New File"; object content = new RichTextBox(); // the AddDocument method will create a new ContentPane for // the given header & content and put that content pane in // the tabgrouppane containing the active pane or a new // tabgrouppane if there aren't any available ContentPane newDocument = this.dmForAddDocument.AddDocument(header, content); newDocument.AllowDocking = false; newDocument.AllowFloatingOnly = false; // the adddocument method doesn't automatically activate the pane // in case you wanted to add multiple panes newDocument.Activate(); }