View 열거형

정의

ListView 컨트롤에 목록 항목이 표시되는 방식을 지정합니다.

public enum class View
public enum View
type View = 
Public Enum View
상속

필드

Details 1

각 항목은 별도의 줄에 표시되며 해당 항목에 대한 추가 정보가 열에 표시됩니다. 가장 왼쪽 열에는 작은 아이콘 및 레이블이 표시되고 그 다음 열에는 애플리케이션에서 지정한 하위 항목이 표시됩니다. 열에는 해당 열의 캡션을 표시할 수 있는 머리글이 표시됩니다. 사용자는 런타임에 각 열의 크기를 조정할 수 있습니다.

LargeIcon 0

각 항목이 아래에 레이블이 있는 전체 화면 크기의 아이콘으로 나타납니다.

List 3

각 항목이 오른쪽에 레이블이 있는 작은 아이콘으로 나타납니다. 열 머리글이 없는 상태로 항목이 열에 정렬됩니다.

SmallIcon 2

각 항목이 오른쪽에 레이블이 있는 작은 아이콘으로 나타납니다.

Tile 4

각 항목이 전체 크기의 아이콘으로 나타나고 그 오른쪽에 항목 레이블과 하위 항목 정보가 표시됩니다. 이 하위 항목 정보는 애플리케이션에서 지정됩니다. 이 뷰는 Windows XP와 Windows Server 2003 제품군에서만 사용할 수 있습니다. 이전 버전의 운영 체제에서는 이 값이 무시되고 ListView 컨트롤이 LargeIcon 뷰에 표시됩니다.

예제

다음 코드 예제에서는 설정 합니다 ListView.View 속성 중 하나에 View 열거형 값입니다. 예제를 실행 하려면 호출을 폼에 다음 코드를 붙여 합니다 InitializeListView 폼의 생성자 또는 Load 메서드.

internal:
   // Declare the Listview object.
   System::Windows::Forms::ListView^ myListView;

private:

   // Initialize the ListView object with subitems of a different
   // style than the default styles for the ListView.
   void InitializeListView()
   {
      // Set the Location, View and Width properties for the 
      // ListView object. 
      myListView = gcnew ListView;
      myListView->Location = System::Drawing::Point( 20, 20 );
      myListView->Width = 250;
      
      // The View property must be set to Details for the 
      // subitems to be visible.
      myListView->View = View::Details;
      
      // Each SubItem object requires a column, so add three columns.
      this->myListView->Columns->Add( "Key", 50, HorizontalAlignment::Left );
      this->myListView->Columns->Add( "A", 100, HorizontalAlignment::Left );
      this->myListView->Columns->Add( "B", 100, HorizontalAlignment::Left );
      
      // Add a ListItem object to the ListView.
      ListViewItem^ entryListItem = myListView->Items->Add( "Items" );
      
      // Set UseItemStyleForSubItems property to false to change 
      // look of subitems.
      entryListItem->UseItemStyleForSubItems = false;
      
      // Add the expense subitem.
      ListViewItem::ListViewSubItem ^ expenseItem = entryListItem->SubItems->Add( "Expense" );
      
      // Change the expenseItem object's color and font.
      expenseItem->ForeColor = System::Drawing::Color::Red;
      expenseItem->Font = gcnew System::Drawing::Font( "Arial",10,System::Drawing::FontStyle::Italic );
      
      // Add a subitem called revenueItem 
      ListViewItem::ListViewSubItem ^ revenueItem = entryListItem->SubItems->Add( "Revenue" );
      
      // Change the revenueItem object's color and font.
      revenueItem->ForeColor = System::Drawing::Color::Blue;
      revenueItem->Font = gcnew System::Drawing::Font( "Times New Roman",10,System::Drawing::FontStyle::Bold );
      
      // Add the ListView to the form.
      this->Controls->Add( this->myListView );
   }

// Declare the Listview object.
internal System.Windows.Forms.ListView myListView;

// Initialize the ListView object with subitems of a different
// style than the default styles for the ListView.
private void InitializeListView()
{

    // Set the Location, View and Width properties for the 
    // ListView object. 
    myListView = new ListView();
    myListView.Location = new System.Drawing.Point(20, 20);
    myListView.Width = 250;

    // The View property must be set to Details for the 
    // subitems to be visible.
    myListView.View = View.Details;
    
    // Each SubItem object requires a column, so add three columns.
    this.myListView.Columns.Add("Key", 50, HorizontalAlignment.Left);
    this.myListView.Columns.Add("A", 100, HorizontalAlignment.Left);
    this.myListView.Columns.Add("B", 100, HorizontalAlignment.Left);

    // Add a ListItem object to the ListView.
    ListViewItem entryListItem = myListView.Items.Add("Items");

    // Set UseItemStyleForSubItems property to false to change 
    // look of subitems.
    entryListItem.UseItemStyleForSubItems = false;

    // Add the expense subitem.
    ListViewItem.ListViewSubItem expenseItem = 
        entryListItem.SubItems.Add("Expense");

    // Change the expenseItem object's color and font.
    expenseItem.ForeColor = System.Drawing.Color.Red;
    expenseItem.Font = new System.Drawing.Font(
        "Arial", 10, System.Drawing.FontStyle.Italic);

    // Add a subitem called revenueItem 
    ListViewItem.ListViewSubItem revenueItem = 
        entryListItem.SubItems.Add("Revenue");

    // Change the revenueItem object's color and font.
    revenueItem.ForeColor = System.Drawing.Color.Blue;
    revenueItem.Font = new System.Drawing.Font(
        "Times New Roman", 10, System.Drawing.FontStyle.Bold);

    // Add the ListView to the form.
    this.Controls.Add(this.myListView);
}

' Declare the Listview object.
Friend WithEvents myListView As System.Windows.Forms.ListView

' Initialize the ListView object with subitems of a different
' style than the default styles for the ListView.
Private Sub InitializeListView()

    ' Set the Location, View and Width properties for the 
    ' ListView object. 
    myListView = New ListView
    With (myListView)
        .Location = New System.Drawing.Point(20, 20)

        ' The View property must be set to Details for the 
        ' subitems to be visible.
        .View = View.Details
        .Width = 250
    End With

    ' Each SubItem object requires a column, so add three columns.
    Me.myListView.Columns.Add("Key", 50, HorizontalAlignment.Left)
    Me.myListView.Columns.Add("A", 100, HorizontalAlignment.Left)
    Me.myListView.Columns.Add("B", 100, HorizontalAlignment.Left)

    ' Add a ListItem object to the ListView.
    Dim entryListItem As ListViewItem = myListView.Items.Add("Items")

    ' Set UseItemStyleForSubItems property to false to change 
    ' look of subitems.
    entryListItem.UseItemStyleForSubItems = False

    ' Add the expense subitem.
    Dim expenseItem As ListViewItem.ListViewSubItem = _
        entryListItem.SubItems.Add("Expense")

    ' Change the expenseItem object's color and font.
    expenseItem.ForeColor = System.Drawing.Color.Red
    expenseItem.Font = New System.Drawing.Font _
        ("Arial", 10, System.Drawing.FontStyle.Italic)

    ' Add a subitem called revenueItem 
    Dim revenueItem As ListViewItem.ListViewSubItem = _
        entryListItem.SubItems.Add("Revenue")

    ' Change the revenueItem object's color and font.
    revenueItem.ForeColor = System.Drawing.Color.Blue
    revenueItem.Font = New System.Drawing.Font _
        ("Times New Roman", 10, System.Drawing.FontStyle.Bold)

    ' Add the ListView to the form.
    Me.Controls.Add(Me.myListView)
End Sub

설명

이 열거형의 멤버 값을 설정 하는 데는 View 의 속성을 ListView 컨트롤입니다.

적용 대상

추가 정보