Aracılığıyla paylaş


DocumentBase.Controls Özellik

Belge üzerinde bulunan yönetilen denetimler topluluğu alır.

Ad alanı:  Microsoft.Office.Tools.Word
Derleme:  Microsoft.Office.Tools.Word.v4.0.Utilities (Microsoft.Office.Tools.Word.v4.0.Utilities.dll içinde)

Sözdizimi

'Bildirim
Public ReadOnly Property Controls As ControlCollection
public ControlCollection Controls { get; }

Özellik Değeri

Tür: Microsoft.Office.Tools.Word.ControlCollection
A ControlCollection belgenin tüm yönetilen denetimleri içeren.

Notlar

Office çözümünü belgedeki Windows Forms denetimlerini ve konak kontrolleri içerir.Daha fazla bilgi için bkz. Office Belgeleri Üzerinde Denetimler.

Örnekler

Aşağıdaki kod örneği, ilk paragraf metni ekler ve oluşturur bir Bookmark paragraf kapsayan denetim.Kod daha sonra belgeyi denetimlerin toplam sayısını görüntüleyen bir ileti kutusu gösterir.Bu örneği kullanmak için çalıştırın ThisDocument bir belge düzeyi projesinde sınıf.

Private Sub DocumentControls()
    Me.Paragraphs(1).Range.InsertParagraphAfter()
    Me.Paragraphs(1).Range.Text = "This is some sample text."
    Me.Controls.AddBookmark(Me.Paragraphs(1).Range, "Bookmark1")
    MessageBox.Show("Total number of controls: " & Me.Controls.Count.ToString())
End Sub
private void DocumentControls()
{
    this.Paragraphs[1].Range.InsertParagraphAfter();
    this.Paragraphs[1].Range.Text = "This is some sample text.";
    this.Controls.AddBookmark(this.Paragraphs[1].Range, "Bookmark1");
    MessageBox.Show("Total number of controls: " +
        this.Controls.Count.ToString());
}

.NET Framework Güvenliği

Ayrıca bkz.

Başvuru

DocumentBase Sınıf

Microsoft.Office.Tools.Word Ad Alanı

Diğer Kaynaklar

Office Belgeleri Üzerinde Denetimler