다음을 통해 공유


ControlExtensions 클래스

Visual Studio의 Office 개발 도구를 사용하여 사용자 지정한 Word 문서에 Windows Forms 컨트롤을 추가하는 데 사용할 수 있는 확장 메서드를 제공합니다.

상속 계층 구조

System.Object
  Microsoft.Office.Tools.Word.ControlExtensions

네임스페이스:  Microsoft.Office.Tools.Word
어셈블리:  Microsoft.Office.Tools.Word.v4.0.Utilities(Microsoft.Office.Tools.Word.v4.0.Utilities.dll)

구문

‘선언
<ExtensionAttribute> _
Public NotInheritable Class ControlExtensions
public static class ControlExtensions

메서드

  이름 설명
Public 메서드정적 멤버 AddButton(ControlCollection, Range, Single, Single, String) 문서의 지정된 위치에 지정된 크기의 새 Button 컨트롤을 추가합니다.
Public 메서드정적 멤버 AddButton(ControlCollection, Single, Single, Single, Single, String) 문서의 지정된 위치에 지정된 크기의 새 Button 컨트롤을 추가합니다.
Public 메서드정적 멤버 AddCheckBox(ControlCollection, Range, Single, Single, String) 문서의 지정된 위치에 지정된 크기의 새 CheckBox 컨트롤을 추가합니다.
Public 메서드정적 멤버 AddCheckBox(ControlCollection, Single, Single, Single, Single, String) 문서의 지정된 위치에 지정된 크기의 새 CheckBox 컨트롤을 추가합니다.
Public 메서드정적 멤버 AddCheckedListBox(ControlCollection, Range, Single, Single, String) 문서의 지정된 위치에 지정된 크기의 새 CheckedListBox 컨트롤을 추가합니다.
Public 메서드정적 멤버 AddCheckedListBox(ControlCollection, Single, Single, Single, Single, String) 문서의 지정된 위치에 지정된 크기의 새 CheckedListBox 컨트롤을 추가합니다.
Public 메서드정적 멤버 AddComboBox(ControlCollection, Range, Single, Single, String) 문서의 지정된 위치에 지정된 크기의 새 ComboBox 컨트롤을 추가합니다.
Public 메서드정적 멤버 AddComboBox(ControlCollection, Single, Single, Single, Single, String) 문서의 지정된 위치에 지정된 크기의 새 ComboBox 컨트롤을 추가합니다.
Public 메서드정적 멤버 AddDataGridView(ControlCollection, Range, Single, Single, String) 문서의 지정된 위치에 지정된 크기의 새 DataGridView 컨트롤을 추가합니다.
Public 메서드정적 멤버 AddDataGridView(ControlCollection, Single, Single, Single, Single, String) 문서의 지정된 위치에 지정된 크기의 새 DataGridView 컨트롤을 추가합니다.
Public 메서드정적 멤버 AddDateTimePicker(ControlCollection, Range, Single, Single, String) 문서의 지정된 위치에 지정된 크기의 새 DateTimePicker 컨트롤을 추가합니다.
Public 메서드정적 멤버 AddDateTimePicker(ControlCollection, Single, Single, Single, Single, String) 문서의 지정된 위치에 지정된 크기의 새 DateTimePicker 컨트롤을 추가합니다.
Public 메서드정적 멤버 AddDomainUpDown(ControlCollection, Range, Single, Single, String) 문서의 지정된 위치에 지정된 크기의 새 DomainUpDown 컨트롤을 추가합니다.
Public 메서드정적 멤버 AddDomainUpDown(ControlCollection, Single, Single, Single, Single, String) 문서의 지정된 위치에 지정된 크기의 새 DomainUpDown 컨트롤을 추가합니다.
Public 메서드정적 멤버 AddHScrollBar(ControlCollection, Range, Single, Single, String) 문서의 지정된 위치에 지정된 크기의 새 HScrollBar 컨트롤을 추가합니다.
Public 메서드정적 멤버 AddHScrollBar(ControlCollection, Single, Single, Single, Single, String) 문서의 지정된 위치에 지정된 크기의 새 HScrollBar 컨트롤을 추가합니다.
Public 메서드정적 멤버 AddLabel(ControlCollection, Range, Single, Single, String) 문서의 지정된 위치에 지정된 크기의 새 Label 컨트롤을 추가합니다.
Public 메서드정적 멤버 AddLabel(ControlCollection, Single, Single, Single, Single, String) 문서의 지정된 위치에 지정된 크기의 새 Label 컨트롤을 추가합니다.
Public 메서드정적 멤버 AddLinkLabel(ControlCollection, Range, Single, Single, String) 문서의 지정된 위치에 지정된 크기의 새 LinkLabel 컨트롤을 추가합니다.
Public 메서드정적 멤버 AddLinkLabel(ControlCollection, Single, Single, Single, Single, String) 문서의 지정된 위치에 지정된 크기의 새 LinkLabel 컨트롤을 추가합니다.
Public 메서드정적 멤버 AddListBox(ControlCollection, Range, Single, Single, String) 문서의 지정된 위치에 지정된 크기의 새 ListBox 컨트롤을 추가합니다.
Public 메서드정적 멤버 AddListBox(ControlCollection, Single, Single, Single, Single, String) 문서의 지정된 위치에 지정된 크기의 새 ListBox 컨트롤을 추가합니다.
Public 메서드정적 멤버 AddListView(ControlCollection, Range, Single, Single, String) 문서의 지정된 위치에 지정된 크기의 새 ListView 컨트롤을 추가합니다.
Public 메서드정적 멤버 AddListView(ControlCollection, Single, Single, Single, Single, String) 문서의 지정된 위치에 지정된 크기의 새 ListView 컨트롤을 추가합니다.
Public 메서드정적 멤버 AddMaskedTextBox(ControlCollection, Range, Single, Single, String) 문서의 지정된 위치에 지정된 크기의 새 MaskedTextBox 컨트롤을 추가합니다.
Public 메서드정적 멤버 AddMaskedTextBox(ControlCollection, Single, Single, Single, Single, String) 문서의 지정된 위치에 지정된 크기의 새 MaskedTextBox 컨트롤을 추가합니다.
Public 메서드정적 멤버 AddMonthCalendar(ControlCollection, Range, Single, Single, String) 문서의 지정된 위치에 지정된 크기의 새 MonthCalendar 컨트롤을 추가합니다.
Public 메서드정적 멤버 AddMonthCalendar(ControlCollection, Single, Single, Single, Single, String) 문서의 지정된 위치에 지정된 크기의 새 MonthCalendar 컨트롤을 추가합니다.
Public 메서드정적 멤버 AddNumericUpDown(ControlCollection, Range, Single, Single, String) 문서의 지정된 위치에 지정된 크기의 새 NumericUpDown 컨트롤을 추가합니다.
Public 메서드정적 멤버 AddNumericUpDown(ControlCollection, Single, Single, Single, Single, String) 문서의 지정된 위치에 지정된 크기의 새 NumericUpDown 컨트롤을 추가합니다.
Public 메서드정적 멤버 AddPictureBox(ControlCollection, Range, Single, Single, String) 문서의 지정된 위치에 지정된 크기의 새 PictureBox 컨트롤을 추가합니다.
Public 메서드정적 멤버 AddPictureBox(ControlCollection, Single, Single, Single, Single, String) 문서의 지정된 위치에 지정된 크기의 새 PictureBox 컨트롤을 추가합니다.
Public 메서드정적 멤버 AddProgressBar(ControlCollection, Range, Single, Single, String) 문서의 지정된 위치에 지정된 크기의 새 ProgressBar 컨트롤을 추가합니다.
Public 메서드정적 멤버 AddProgressBar(ControlCollection, Single, Single, Single, Single, String) 문서의 지정된 위치에 지정된 크기의 새 ProgressBar 컨트롤을 추가합니다.
Public 메서드정적 멤버 AddPropertyGrid(ControlCollection, Range, Single, Single, String) 문서의 지정된 위치에 지정된 크기의 새 PropertyGrid 컨트롤을 추가합니다.
Public 메서드정적 멤버 AddPropertyGrid(ControlCollection, Single, Single, Single, Single, String) 문서의 지정된 위치에 지정된 크기의 새 PropertyGrid 컨트롤을 추가합니다.
Public 메서드정적 멤버 AddRadioButton(ControlCollection, Range, Single, Single, String) 문서의 지정된 위치에 지정된 크기의 새 RadioButton 컨트롤을 추가합니다.
Public 메서드정적 멤버 AddRadioButton(ControlCollection, Single, Single, Single, Single, String) 문서의 지정된 위치에 지정된 크기의 새 RadioButton 컨트롤을 추가합니다.
Public 메서드정적 멤버 AddRichTextBox(ControlCollection, Range, Single, Single, String) 문서의 지정된 위치에 지정된 크기의 새 RichTextBox 컨트롤을 추가합니다.
Public 메서드정적 멤버 AddRichTextBox(ControlCollection, Single, Single, Single, Single, String) 문서의 지정된 위치에 지정된 크기의 새 RichTextBox 컨트롤을 추가합니다.
Public 메서드정적 멤버 AddTextBox(ControlCollection, Range, Single, Single, String) 문서의 지정된 위치에 지정된 크기의 새 TextBox 컨트롤을 추가합니다.
Public 메서드정적 멤버 AddTextBox(ControlCollection, Single, Single, Single, Single, String) 문서의 지정된 위치에 지정된 크기의 새 TextBox 컨트롤을 추가합니다.
Public 메서드정적 멤버 AddTrackBar(ControlCollection, Range, Single, Single, String) 문서의 지정된 위치에 지정된 크기의 새 TrackBar 컨트롤을 추가합니다.
Public 메서드정적 멤버 AddTrackBar(ControlCollection, Single, Single, Single, Single, String) 문서의 지정된 위치에 지정된 크기의 새 TrackBar 컨트롤을 추가합니다.
Public 메서드정적 멤버 AddTreeView(ControlCollection, Range, Single, Single, String) 문서의 지정된 위치에 지정된 크기의 새 TreeView 컨트롤을 추가합니다.
Public 메서드정적 멤버 AddTreeView(ControlCollection, Single, Single, Single, Single, String) 문서의 지정된 위치에 지정된 크기의 새 TreeView 컨트롤을 추가합니다.
Public 메서드정적 멤버 AddVScrollBar(ControlCollection, Range, Single, Single, String) 문서의 지정된 위치에 지정된 크기의 새 VScrollBar 컨트롤을 추가합니다.
Public 메서드정적 멤버 AddVScrollBar(ControlCollection, Single, Single, Single, Single, String) 문서의 지정된 위치에 지정된 크기의 새 VScrollBar 컨트롤을 추가합니다.
Public 메서드정적 멤버 AddWebBrowser(ControlCollection, Range, Single, Single, String) 문서의 지정된 위치에 지정된 크기의 새 WebBrowser 컨트롤을 추가합니다.
Public 메서드정적 멤버 AddWebBrowser(ControlCollection, Single, Single, Single, Single, String) 문서의 지정된 위치에 지정된 크기의 새 WebBrowser 컨트롤을 추가합니다.

위쪽

설명

ControlExtensions 메서드는 런타임에 Document.Controls 속성(응용 프로그램 수준 프로젝트에서) 또는 DocumentBase.Controls 속성(문서 수준 프로젝트에서)에서 반환된 ControlCollection 개체에서 사용할 수 있는 확장 메서드입니다.문서에 특정 컨트롤을 추가하려면 메서드 이름에 컨트롤 이름이 포함된 메서드를 사용합니다.예를 들어, Button를 추가하려면 AddButton 메서드를 사용합니다.

문서에 컨트롤을 추가하는 방법에 대한 자세한 내용은 런타임에 Office 문서에 컨트롤 추가를 참조하십시오.확장 메서드에 대한 자세한 내용은 확장 메서드(C# 프로그래밍 가이드)확장 메서드(Visual Basic)를 참조하십시오.

[!참고]

.NET Framework 4를 대상으로 하는 Word 추가 기능 프로젝트에서 ControlExtensions 메서드에 액세스하려면 먼저 Microsoft.Office.Tools.Word.v4.0.Utilities.dll 어셈블리에 대한 참조를 추가해야 합니다.

예제

다음 코드 예제에서는 AddButton 메서드를 사용하여 Button 컨트롤을 문서의 첫째 단락에 추가한 다음 텍스트를 단추에 추가합니다.이 예제를 사용하려면 문서 수준 프로젝트 ThisDocument 클래스에서 실행하십시오.

Private Sub WordRangeAddButton()
    Me.Paragraphs(1).Range.InsertParagraphBefore()
    Dim Button1 As Microsoft.Office.Tools.Word.Controls.Button _
        = Me.Controls.AddButton(Me.Paragraphs(1).Range, 56.25F, _
        17.25F, "Button1")
    Button1.Text = "OK"
End Sub 
private void WordRangeAddButton()
{
    this.Paragraphs[1].Range.InsertParagraphBefore();
    Microsoft.Office.Tools.Word.Controls.Button button1 =
        this.Controls.AddButton(this.Paragraphs[1].Range,
        56.25F, 17.25F, "button1");
    button1.Text = "OK";
}

스레드로부터의 안전성

이 형식의 모든 공용 static(Visual Basic의 경우 Shared) 멤버는 스레드로부터 안전합니다. 인터페이스 멤버는 스레드로부터 안전하지 않습니다.

참고 항목

참조

Microsoft.Office.Tools.Word 네임스페이스

기타 리소스

런타임에 Office 문서에 컨트롤 추가