Results 1 to 2 of 2

Thread: Displaying a listview via VBScript

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2000
    Posts
    11

    Angry

    I'm sure this is straightforward, but I haven't figured it out, yet. How do I get my listview to display within script? Here's the code I'm trying...

    And no, I'm not sure of the syntax. Is there a good code repository anywhere? I can't seem to find many good VBScript links.

    Thanks.

    <HTML>

    <HEAD>

    <SCRIPT LANGUAGE=VBScript>

    <!-- Hide from older browsers.

    function init()
    dim hdr
    dim itmX

    set hdr = document.frmTest.lvwTest.ColumnHeaders
    hdr.Add ,"One","One",300
    document.frmTest.lvwTest.ColumnHeaders.Add ,"Two","Two",300
    Set itmX = document.frmTest.lvwTest.ListItems.Add (,"XXX","XXX")
    itmX.SubItems(1) = "Two"

    msgbox "Yummy"

    end function

    -->

    </SCRIPT>

    </HEAD>

    <BODY Name=frmTest>

    <OBJECT ClassID="clsid:58DA8D8A-9D6A-101B-AFC0-4210102A8DA7" Name=lvwTest Width=100 Height=100>
    <PARAM Name=View Value=0>
    <PARAM Name=Enabled Value=1>
    </OBJECT>

    <SCRIPT LANGUAGE=VBScript>
    init()
    </SCRIPT>

    </BODY>

    </HTML>

  2. #2

    Thread Starter
    New Member
    Join Date
    Jun 2000
    Posts
    11

    Wink Resolved

    Got it, thanks.

    <HTML>

    <SCRIPT LANGUAGE=VBScript><!--

    Sub Init()
    dim itmX

    lvwMain.ColumnHeaders.Add ,,"NAME", 150
    lvwMain.ColumnHeaders.Add ,,"APARTMENT", 175

    set itmX = lvwMain.ListItems.Add(1,,"CHANDLER")
    itmX.SubItems(1) = "6A"
    set itmX = lvwMain.ListItems.Add(2,,"JOEY")
    itmX.SubItems(1) = "6A"
    set itmX = lvwMain.ListItems.Add(3,,"MONICA")
    itmX.SubItems(1) = "6B"

    End Sub

    --></SCRIPT>

    <BODY OnLoad="Init">

    <OBJECT classid="clsid:BDD1F04B-858B-11D1-B16A-00C0F0283628"
    Name=lvwMain
    Height=400
    width=350>
    <PARAM NAME="View" VALUE="3">
    <PARAM NAME="Checkboxes" VALUE="-1">
    </OBJECT>

    </BODY>

    </HTML>


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