listvieuw insert data

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Gurk

    listvieuw insert data

    at the moment i've git this code and it works fine

    Private Sub Command2_Click( )

    Dim clmX As ColumnHeader

    Set clmX = ListView1.Colum nHeaders. _
    Add(, , "IO", ListView1.Width / 10)

    For intI = 1 To 16
    strIO = GetINI("IO", "IO" & intI, "?")

    If strIO = "input" Then

    Set clmX = ListView1.Colum nHeaders. _
    Add(, , intI, ListView1.Width / 40)


    End If
    Next intI

    ListView1.View = 3


    no meightby a simple question, but is there a way to add values into certain
    collomns.

    thanks Maarten


  • Randy Birch

    #2
    Re: listvieuw insert data

    Not sure I understand what you're asking. Once you've added the
    columnheaders, you can add listitems to the control. For each list item
    added you can add subitem data, just like the details view in explorer. You
    can not have a line with only subitem data ... there has to be a main item
    even if it is a space.

    dim itmx as listitem

    set itmx = listview1.listi tems.add (,,"item1")
    itmx.subitems(1 ) = "second column data"
    itmx.subitems(2 ) = "third column data"
    ...etc

    Once the item is added, you can later change the subitem data using:

    listview1.listi tems(1).subitem s(1) = "new second column data"

    .... or

    listview1.lists ubitems(1) = "new second column data"

    .... or by a reference ...

    set itmx = listview1.listi tem(1)
    itmx.subitems(1 ) = "new second column data"

    --

    Randy Birch
    MVP Visual Basic

    Please respond only to the newsgroups so all can benefit.


    "Gurk" <gurkjaan@hotma il.com> wrote in message
    news:4124c877$0 $3553$ba620e4c@ news.skynet.be. ..
    : at the moment i've git this code and it works fine
    :
    : Private Sub Command2_Click( )
    :
    : Dim clmX As ColumnHeader
    :
    : Set clmX = ListView1.Colum nHeaders. _
    : Add(, , "IO", ListView1.Width / 10)
    :
    : For intI = 1 To 16
    : strIO = GetINI("IO", "IO" & intI, "?")
    :
    : If strIO = "input" Then
    :
    : Set clmX = ListView1.Colum nHeaders. _
    : Add(, , intI, ListView1.Width / 40)
    :
    :
    : End If
    : Next intI
    :
    : ListView1.View = 3
    :
    :
    : no meightby a simple question, but is there a way to add values into
    certain
    : collomns.
    :
    : thanks Maarten
    :
    :

    Comment

    • Gurk

      #3
      Re: listvieuw insert data

      thank you verry much

      you helped me a long way ahead
      kind regards Maarten


      "Randy Birch" <rgb_removethis @mvps.org> wrote in message
      news:qweVc.1117 $Yzm.966@news04 .bloor.is.net.c able.rogers.com ...[color=blue]
      > Not sure I understand what you're asking. Once you've added the
      > columnheaders, you can add listitems to the control. For each list item
      > added you can add subitem data, just like the details view in explorer.[/color]
      You[color=blue]
      > can not have a line with only subitem data ... there has to be a main item
      > even if it is a space.
      >
      > dim itmx as listitem
      >
      > set itmx = listview1.listi tems.add (,,"item1")
      > itmx.subitems(1 ) = "second column data"
      > itmx.subitems(2 ) = "third column data"
      > ...etc
      >
      > Once the item is added, you can later change the subitem data using:
      >
      > listview1.listi tems(1).subitem s(1) = "new second column data"
      >
      > ... or
      >
      > listview1.lists ubitems(1) = "new second column data"
      >
      > ... or by a reference ...
      >
      > set itmx = listview1.listi tem(1)
      > itmx.subitems(1 ) = "new second column data"
      >
      > --
      >
      > Randy Birch
      > MVP Visual Basic
      > http://vbnet.mvps.org/
      > Please respond only to the newsgroups so all can benefit.
      >
      >
      > "Gurk" <gurkjaan@hotma il.com> wrote in message
      > news:4124c877$0 $3553$ba620e4c@ news.skynet.be. ..
      > : at the moment i've git this code and it works fine
      > :
      > : Private Sub Command2_Click( )
      > :
      > : Dim clmX As ColumnHeader
      > :
      > : Set clmX = ListView1.Colum nHeaders. _
      > : Add(, , "IO", ListView1.Width / 10)
      > :
      > : For intI = 1 To 16
      > : strIO = GetINI("IO", "IO" & intI, "?")
      > :
      > : If strIO = "input" Then
      > :
      > : Set clmX = ListView1.Colum nHeaders. _
      > : Add(, , intI, ListView1.Width / 40)
      > :
      > :
      > : End If
      > : Next intI
      > :
      > : ListView1.View = 3
      > :
      > :
      > : no meightby a simple question, but is there a way to add values into
      > certain
      > : collomns.
      > :
      > : thanks Maarten
      > :
      > :
      >[/color]


      Comment

      Working...