[Help]Listview[Solved]

Posts 16–20 of 20 · Page 2 of 2
A. Does that get rid of the null error?

and B. again, rather extensive, if you were using a database it would be so much easier

C. Why would you sort sub items?.....
I'm not talking about the sorting, I'm talking about adding =D

This is what I have to add.

What about the remaining columns?

Code:
Dim lv As ListViewItem = ListView1.Items.Add(iname.Text) 
            'The remaining columns are subitems   
            lv.SubItems.Add(enterip.Text) 
            lv.SubItems.Add(enterport.Text) 
            lv.SubItems.Add(iplayers.Text) 
            lv.SubItems.Add(imap.Text)
List View (in General)

I am offering a general notated outlook into listview, this should help

[php]
'Allow the user to edit item text
'Comment this part out if you don't want it
ListView1.View = View.Details
' Allows the user to use checkmarks for multi select
ListView1.CheckBoxes = True

' Add Columns
ListView1.Columns.Add("Code", 100, HorizontalAlignment.Center)

ListView1.Columns.Add("OS", 100, HorizontalAlignment.Center)

ListView1.Columns.Add("CPU", 100, HorizontalAlignment.Center)

ListView1.Columns.Add("Memory", 100, HorizontalAlignment.Center)


'Listview UI Settings
' This will add to the list Testing to the Listview under code
Dim itts As New System.Windows.Forms.ListViewItem("Testing")


itts.BackColor = System.Drawing.Color.Silver
itts.ForeColor = System.Drawing.Color.Navy
itts.Checked = True


'add sub items
' This will go under OS
Dim itts2 As New System.Windows.Forms.ListViewItem.ListViewSubItem( itts, "Sub_Item")

'This Will Go under CPU
Dim itts3 As New System.Windows.Forms.ListViewItem.ListViewSubItem( itts, "Sub_Item")

'This will Go under Memory
Dim itts4 As New System.Windows.Forms.ListViewItem.ListViewSubItem( itts, "Sub_Item")

'This Will actually add the Sub items
itts.SubItems.Add(itts2)
itts.SubItems.Add(itts3)
itts.SubItems.Add(itts4)


ListView1.Items.Add(itts)
[/php]



Figured it out...

tyvm nextgen...


Code:
If ListView1.FindItemWithText(enterip.Text) Is Nothing Then

            Dim lv As ListViewItem = ListView1.Items.Add(enterip.Text)
            'The remaining columns are subitems   
            lv.SubItems.Add(enterip.Text)
            lv.SubItems.Add(enterport.Text)
            lv.SubItems.Add(iplayers.Text)
            lv.SubItems.Add(imap.Text)
        Else
            MsgBox("You already added this server to your server list.")
        End If
Not a problem

/solved
Posts 16–20 of 20 · Page 2 of 2
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us