ListViewItem.Text プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > ListViewItem.Text プロパティの意味・解説 

ListViewItem.Text プロパティ

項目のテキスト取得または設定します

名前空間: System.Windows.Forms
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)
構文構文

<LocalizableAttribute(True)> _
Public Property Text As
 String
Dim instance As ListViewItem
Dim value As String

value = instance.Text

instance.Text = value
[LocalizableAttribute(true)] 
public string Text { get;
 set; }
[LocalizableAttribute(true)] 
public:
property String^ Text {
    String^ get ();
    void set (String^ value);
}
/** @property */
public String get_Text ()

/** @property */
public void set_Text (String value)

プロパティ
項目を示すために表示するテキスト

解説解説
使用例使用例

ListViewItem を初期化しTag プロパティText プロパティ設定する方法を、次のコード例示します。この例を実行するには、ListView1 という名前の ListView配置されているフォーム次のコード貼り付けフォームコンストラクタまたは Loadイベント処理メソッドから InitializeListViewItems呼び出します。

Private Sub InitializeListViewItems()
    ListView1.View = View.List
    Dim aCursor As Cursor

    Dim favoriteCursors() As Cursor = New
 Cursor() _
                {Cursors.Help, Cursors.Hand, Cursors.No, Cursors.Cross}

    ' Populate the ListView control with the array of Cursors.
    For Each aCursor In
 favoriteCursors

        ' Construct the ListViewItem object
        Dim item As New
 ListViewItem

        ' Set the Text property to the cursor name.
        item.Text = aCursor.ToString

        ' Set the Tag property to the cursor.
        item.Tag = aCursor

        ' Add the ListViewItem to the ListView.
        ListView1.Items.Add(item)
    Next
End Sub
private void InitializeListViewItems()
{
    ListView1.View = View.List;
    

    Cursor[] favoriteCursors = new Cursor[]{Cursors.Help, 
        Cursors.Hand, Cursors.No, Cursors.Cross};

    // Populate the ListView control with the array of Cursors.
    foreach ( Cursor aCursor in favoriteCursors
 )
    {

        // Construct the ListViewItem object
        ListViewItem item = new ListViewItem();

        // Set the Text property to the cursor name.
        item.Text = aCursor.ToString();

        // Set the Tag property to the cursor.
        item.Tag = aCursor;

        // Add the ListViewItem to the ListView.
        ListView1.Items.Add(item);
    }
}
private:
   void InitializeListViewItems()
   {
      ListView1->View = View::List;
      array<System::Windows::Forms::Cursor^>^favoriteCursors = {Cursors::Help
,Cursors::Hand,Cursors::No,Cursors::Cross};
      
      // Populate the ListView control with the array of Cursors.
      System::Collections::IEnumerator^ myEnum = favoriteCursors->GetEnumerator();
      while ( myEnum->MoveNext() )
      {
         System::Windows::Forms::Cursor^ aCursor = safe_cast<System::Windows::Forms::Cursor^>(myEnum->Current);
         
         // Construct the ListViewItem object
         ListViewItem^ item = gcnew ListViewItem;
         
         // Set the Text property to the cursor name.
         item->Text = aCursor->ToString();
         
         // Set the Tag property to the cursor.
         item->Tag = aCursor;
         
         // Add the ListViewItem to the ListView.
         ListView1->Items->Add( item );
      }
   }
private void InitializeListViewItems()
{
    listView1.set_View(View.List);

    Cursor favoriteCursors[] = new Cursor[] { Cursors.get_Help()
,
        Cursors.get_Hand(), Cursors.get_No(), Cursors.get_Cross() };
    // Populate the ListView control with the array of Cursors.
    for (int iCtr = 0; iCtr < favoriteCursors.length;
 iCtr++) {
        Cursor aCursor = favoriteCursors[iCtr];
        // Construct the ListViewItem object
        ListViewItem item = new ListViewItem();
        // Set the Text property to the cursor name.
        item.set_Text(aCursor.ToString());
        // Set the Tag property to the cursor.
        item.set_Tag(aCursor);
        // Add the ListViewItem to the ListView.
        listView1.get_Items().Add(item);
    }
} //InitializeListViewItems
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
ListViewItem クラス
ListViewItem メンバ
System.Windows.Forms 名前空間
ListViewItem.BackColor プロパティ
ListViewItem.ForeColor プロパティ
ListViewItem.Font プロパティ
ListView.LabelWrap プロパティ


このページでは「.NET Framework クラス ライブラリ リファレンス」からListViewItem.Text プロパティを検索した結果を表示しています。
Weblioに収録されているすべての辞書からListViewItem.Text プロパティを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からListViewItem.Text プロパティ を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「ListViewItem.Text プロパティ」の関連用語

ListViewItem.Text プロパティのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



ListViewItem.Text プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS