c# - Pulling an item from listview -


I am trying to pull a value from a listview and display it in a label. If I wanted to draw "Data three" from the first item, then I was trying the following:

  Private zeros frmNotifications_Load (Object Sender, EventArgs) {Settings.Items.Clear (); ListViewItem Item = New ListViewItem ("First item"); Item.SubItems.Add ("Data One"); Item.SubItems.Add ("Data Two"); Item.SubItems.Add ("Data Three"); Item.SubItems.Add ("Data Four"); Settings.Items.Add (item); ListViewItem Item = New ListViewItem ("Second Item"); Item.SubItems.Add ("Data One"); Item.SubItems.Add ("Data Two"); Item.SubItems.Add ("Data Three"); Item.SubItems.Add ("Data Four"); Settings.Items.Add (item); LblData.text = Settings.GetItemAt (1, 4). Text; }  

My last row is not set back for an object reference object

Actually get the value of the "text" information for the item, what you want to do, it can be obtained by:

  var newVariable = ListView1.Items [1] .SubItems [1]. Text  

Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -