Results 1 to 5 of 5

Thread: [RESOLVED] Create ListView by Code

  1. #1

    Thread Starter
    Addicted Member g-mie's Avatar
    Join Date
    Jan 2004
    Location
    EarTh
    Posts
    212

    Resolved [RESOLVED] Create ListView by Code

    Hello Gurus...

    How to create ListView on the form by using coding?

    Thanks
    Last edited by g-mie; Jul 20th, 2006 at 08:52 AM.

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Create ListView by Code

    Do you mean populate a ListView?

    To create one, just add the component to your project, and draw the control on a form.

  3. #3

    Thread Starter
    Addicted Member g-mie's Avatar
    Join Date
    Jan 2004
    Location
    EarTh
    Posts
    212

    Re: Create ListView by Code

    I want to create ListView component by using coding.
    I do not want use Listview component from ToolBox

    How to do it?

  4. #4
    Frenzied Member Andrew G's Avatar
    Join Date
    Nov 2005
    Location
    Sydney
    Posts
    1,587

    Re: Create ListView by Code

    1. Goto Project -> {projectname} properties -> Make (tab) -> Uncheck "Remove information about unused ActiveX components".
    2. Add "Microsoft Windows Common Controls 5.0"

    Then use this code...


    VB Code:
    1. Dim LstView As ListView
    2.  
    3. Private Sub Form_Load()
    4. Set LstView = Me.Controls.Add("COMCTL.ListViewCtrl.1", "newListView")
    5. With LstView
    6.         .Left = 1000
    7.         .Top = 1000
    8.         .Width = 2000
    9.         .Height = 500
    10.         .Visible = True
    11. End With
    12. End Sub


    For other controls - http://www.vbforums.com/showthread.php?t=342054
    Last edited by Andrew G; Jul 20th, 2006 at 07:51 AM.

  5. #5

    Thread Starter
    Addicted Member g-mie's Avatar
    Join Date
    Jan 2004
    Location
    EarTh
    Posts
    212

    Re: Create ListView by Code

    TQ Andrew G.
    I got it.
    Thanks again

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