Results 1 to 5 of 5

Thread: label number 0/0 help

  1. #1

    Thread Starter
    Banned
    Join Date
    Jun 2022
    Posts
    149

    label number 0/0 help

    i have a listview1 and this is the code i have.

    Code:
    Dim ids As Integer
     ids = 0
     ids = frmChat.ListView1.ListItems.Count + 1
     'Ids: Increment ListView Row Index for Next Record
     frmChat.ListView1.ListItems.Add , , "Jessica"
     frmChat.ListView1.ListItems(ids).ListSubItems.Add , , "fen of awar"
     frmChat.ListView1.ListItems(ids).ListSubItems.Add , , "2v2 3v3"
    frmChat.ListView1.ListItems(ids).ListSubItems.Add , , ids
    frmChat.ListView1.ListItems(ids).ListSubItems.Add , , "233ccaac27ccba42"
    this code here
    Code:
    frmChat.ListView1.ListItems(ids).ListSubItems.Add , , ids
    user count.

    deleted.

    updated

    Code:
    Private Sub Command1_Click()
    
    Dim numReceiving As Integer
    Dim numTotal As Integer
    numReceiving = numReceiving + 3
    numTotal = numTotal + 4
    lblListeners.Caption = numReceiving & "/" & numTotal
    End Sub
    how do i add this to listview1
    Last edited by jenniger9; Aug 10th, 2022 at 08:28 AM.

  2. #2

    Thread Starter
    Banned
    Join Date
    Jun 2022
    Posts
    149

    Re: label number 0/0 help

    updated post1

  3. #3
    Smooth Moperator techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,537

    Re: label number 0/0 help

    The same way you added the other fields ... with a .Add and .Subitems ...


    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  4. #4

    Thread Starter
    Banned
    Join Date
    Jun 2022
    Posts
    149

    Re: label number 0/0 help

    Quote Originally Posted by techgnome View Post
    The same way you added the other fields ... with a .Add and .Subitems ...


    -tg
    Code:
    frmChat.ListView1.ListItems(ids).ListSubItems.Add , , "0/8"

    this code searchs for the first colum for username to knowing which user to look for.
    and now how do i update the value because i cannot use add ?

    Code:
    For i = ListView1.ListItems.Count To 1 Step -1
    If ListView1.ListItems(i).Text = frmClient.txtNick.Text Then
     
    
    End If
    Next
    0/8
    increment the 0 so it max 8/8

    Code:
    For i = ListView1.ListItems.Count To 1 Step -1
    'If ListView1.ListItems(i).Selected = True Then
    If ListView1.ListItems(i).Text = frmClient.txtNick.Text Then
    If ListView1.ListItems(ids).ListSubItems.Item.Text = "0/8" Then
    ListView1.ListItems(ids).ListSubItems.Item.Text = "1/8"
    End If
    
    End If
    
    'End If
    Next
    not working and also i think this is not the best way to archive this
    Last edited by jenniger9; Aug 10th, 2022 at 09:44 AM.

  5. #5
    Smooth Moperator techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,537

    Re: label number 0/0 help

    Code:
    ListView1.ListItems(ids).ListSubItems.Item.Text = "1/8
    You need to specify the index of the subitem you want to change.

    check out the first answer here... https://stackoverflow.com/questions/...iew-at-runtime


    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width