Results 1 to 18 of 18

Thread: Showing list of formname in a listview

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2009
    Location
    Watch Window(Shift+f9)
    Posts
    1,879

    Question Showing list of formname in a listview

    can anybody tell me .Why i am getting Invalid Property Value ?.Kindly let me know the idea.Any help would be highly appreciated.here is the following code
    What i have written.
    Code:
    Public Function FillListView()
     Dim item As ListItem
      Set item = ListView1.ListItems.Add(, , "item")
           item.SubItems(1) = "frmSupplier"
    End Function

  2. #2
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    Re: Showing list of formname in a listview

    ~Edit~:

    The problem is, there is no subitems found... Right click the listview and select properties. Then select Column Headers tab. Then click the Insert Column button(do it again for creating another column). Then try the code.
    Last edited by akhileshbc; Jan 25th, 2010 at 08:26 AM.

    If my post was helpful to you, then express your gratitude using Rate this Post.
    And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
    My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet

    Social Group: VBForums - Developers from India


    Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2009
    Location
    Watch Window(Shift+f9)
    Posts
    1,879

    Question Re: Showing list of formname in a listview

    Still not working it say Compiler Error .syntax Error .Kindly let me know the idea.Any help would be highly appreciated.Kindly find the attachment also.
    Last edited by firoz.raj; May 30th, 2011 at 02:09 PM.

  4. #4
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    Re: Showing list of formname in a listview

    Please see the edited post above....

    If my post was helpful to you, then express your gratitude using Rate this Post.
    And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
    My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet

    Social Group: VBForums - Developers from India


    Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...

  5. #5

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2009
    Location
    Watch Window(Shift+f9)
    Posts
    1,879

    Question Re: Showing list of formname in a listview

    Column is already added there .But still getting same Error .Kindly let me know the idea.Kindly find the attachment also.
    Last edited by firoz.raj; May 30th, 2011 at 02:09 PM.

  6. #6
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: Showing list of formname in a listview

    The 1st column is the listview Item's .Text property. The 2nd column is .SubItem(1), 3rd item is .SubItem(2), etc.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  7. #7
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    Re: Showing list of formname in a listview

    Yeah... That means you have to create two columns...

    If my post was helpful to you, then express your gratitude using Rate this Post.
    And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
    My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet

    Social Group: VBForums - Developers from India


    Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...

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

    Re: Showing list of formname in a listview

    Just do this
    Code:
    Set item = ListView1.ListItems.Add(, , "frmSupplier")

  9. #9
    Lively Member agent_007's Avatar
    Join Date
    Jan 2010
    Posts
    93

    Re: Showing list of formname in a listview

    Quote Originally Posted by firoz.raj View Post
    can anybody tell me .Why i am getting Invalid Property Value ?.Kindly let me know the idea.Any help would be highly appreciated.here is the following code
    What i have written.
    Code:
    Public Function FillListView()
     Dim item As ListItem
      Set item = ListView1.ListItems.Add(, , "item")
           item.SubItems(1) = "frmSupplier"
    End Function
    Try This it will work

    Code:
    Public Function FillListView()
    ListView1.ColumnHeaders.Clear
    ListView1.ColumnHeaders.Add , , "ITEM", 1444, lvwColumnLeft
    ListView1.ColumnHeaders.Add , , "FORMNAME", 1444, lvwColumnRight
    ListView1.View = 3
     Dim item As ListItem
    Set item = ListView1.ListItems.Add(, , "item")
    item.SubItems(1) = "frmSupplier"
    End Function
    Last edited by agent_007; Jan 25th, 2010 at 01:26 PM.

    Im Pro in C#,VB.NET,Batch,Socket Programming, SPY Software Programming, VB6, Win32Api, VBscript, Windows Registry, ASP.NET, PHP, Jquery, AJAX.

  10. #10

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2009
    Location
    Watch Window(Shift+f9)
    Posts
    1,879

    Question Re: Showing list of formname in a listview

    I Want to place all the form names in a Column one but alll the form name is
    not comming in a listview subitem(1).Here is the following Code What i have
    written.Kindly let me know the idea.Any help would be highly appreciated.
    Kindly find the attachment also.
    Code:
    Public Function FillListView()
     ListView1.ColumnHeaders.Clear
    ListView1.ColumnHeaders.Add , , "ITEM", 1444, lvwColumnLeft
    ListView1.ColumnHeaders.Add , , "FORMNAMES", 1444, lvwColumnRight
    'ListView1.ColumnHeaders.Add , , "FORMNAME", 1444, lvwColumnRight
    'ListView1.ColumnHeaders.Add , , "FORMNAME", 1444, lvwColumnRight
    ListView1.View = 3
     Dim item As ListItem
    Set item = ListView1.ListItems.Add(, , "item")
    item.SubItems(1) = "frmSupplier"
    item.SubItems(1) = "Frmpermissions"
    item.SubItems(1) = "frmsupplierModify"
    End Function
    Last edited by firoz.raj; May 30th, 2011 at 02:09 PM.

  11. #11
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: Showing list of formname in a listview

    I think there is miscommunication. Can you simply show us what it is suppose to look like on paper? No code, just typed out, spaced out?
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  12. #12
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    Re: Showing list of formname in a listview

    Try this :
    Code:
    Public Function FillListView()
     ListView1.ColumnHeaders.Clear
    ListView1.ColumnHeaders.Add , , "ITEM", 1444, lvwColumnLeft
    ListView1.ColumnHeaders.Add , , "FORMNAMES", 1444, lvwColumnRight
    
    ListView1.View = 3
     Dim item As ListItem
    Set item = ListView1.ListItems.Add(, , "item1")
    item.SubItems(1) = "frmSupplier"
    
    Set item = ListView1.ListItems.Add(, , "item2")
    item.SubItems(1) = "Frmpermissions"
    
    Set item = ListView1.ListItems.Add(, , "item3")
    item.SubItems(1) = "frmsupplierModify"
    
    End Function

    If my post was helpful to you, then express your gratitude using Rate this Post.
    And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
    My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet

    Social Group: VBForums - Developers from India


    Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...

  13. #13
    Lively Member agent_007's Avatar
    Join Date
    Jan 2010
    Posts
    93

    Re: Showing list of formname in a listview

    Quote Originally Posted by firoz.raj View Post
    I Want to place all the form names in a Column one but alll the form name is
    not comming in a listview subitem(1).Here is the following Code What i have
    written.Kindly let me know the idea.Any help would be highly appreciated.
    Kindly find the attachment also.
    Code:
    Public Function FillListView()
     ListView1.ColumnHeaders.Clear
    ListView1.ColumnHeaders.Add , , "ITEM", 1444, lvwColumnLeft
    ListView1.ColumnHeaders.Add , , "FORMNAMES", 1444, lvwColumnRight
    'ListView1.ColumnHeaders.Add , , "FORMNAME", 1444, lvwColumnRight
    'ListView1.ColumnHeaders.Add , , "FORMNAME", 1444, lvwColumnRight
    ListView1.View = 3
     Dim item As ListItem
    Set item = ListView1.ListItems.Add(, , "item")
    item.SubItems(1) = "frmSupplier"
    item.SubItems(1) = "Frmpermissions"
    item.SubItems(1) = "frmsupplierModify"
    End Function
    im confused how many columns you want one or two if two than see ABC's code above if one column then Try this out and reply


    Code:
    Public Function FillListView()
     ListView1.ColumnHeaders.Clear
    ListView1.ColumnHeaders.Add , , "FormName", 1444, lvwColumnLeft
    ListView1.View = 3
    ListView1.ListItems.Add(1).Text = "frmSupplier"
    ListView1.ListItems.Add(2).Text = "frmpermissions"
    ListView1.ListItems.Add(3).Text = "frmsupplierModify"
    End Function

    Im Pro in C#,VB.NET,Batch,Socket Programming, SPY Software Programming, VB6, Win32Api, VBscript, Windows Registry, ASP.NET, PHP, Jquery, AJAX.

  14. #14
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    Re: Showing list of formname in a listview

    @agent: I think he wants two column and three rows...

    If my post was helpful to you, then express your gratitude using Rate this Post.
    And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
    My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet

    Social Group: VBForums - Developers from India


    Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...

  15. #15

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2009
    Location
    Watch Window(Shift+f9)
    Posts
    1,879

    Question Re: Showing list of formname in a listview

    it is comming in three column. i need in one column.one after the other in a list.as a list.kindly let me know the idea.Any help would be highly appreciated.
    Code:
    ListView1.ListItems.Add(1).Text = "frmSupplier"
    ListView1.ListItems.Add(2).Text = "frmpermissions"
    ListView1.ListItems.Add(3).Text = "frmsupplierModify"

  16. #16
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    Re: Showing list of formname in a listview

    Try this....
    Code:
    Dim item As ListItem
    Set item = ListView1.ListItems.Add(, , "frmSupplier")
    Set item = ListView1.ListItems.Add(, , "frmpermissions")
    Set item = ListView1.ListItems.Add(, , "frmsupplierModify")

    If my post was helpful to you, then express your gratitude using Rate this Post.
    And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
    My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet

    Social Group: VBForums - Developers from India


    Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...

  17. #17
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    Re: Showing list of formname in a listview

    Another version...
    Code:
    ListView1.View = lvwReport '~~~> Set the display type to report
    ListView1.ColumnHeaders.Add , , "Forms", 1444, lvwColumnLeft '~~> Create one column
    ListView1.ListItems.Add , , "frmSupplier"  '~~> Add data to the column (ie. row)
    ListView1.ListItems.Add , , "frmpermissions"
    ListView1.ListItems.Add , , "frmsupplierModify"
    Last edited by akhileshbc; Jan 26th, 2010 at 05:53 AM. Reason: added the name of Forms

    If my post was helpful to you, then express your gratitude using Rate this Post.
    And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
    My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet

    Social Group: VBForums - Developers from India


    Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...

  18. #18
    Lively Member agent_007's Avatar
    Join Date
    Jan 2010
    Posts
    93

    Re: Showing list of formname in a listview

    Quote Originally Posted by firoz.raj View Post
    it is comming in three column. i need in one column.one after the other in a list.as a list.kindly let me know the idea.Any help would be highly appreciated.
    Code:
    ListView1.ListItems.Add(1).Text = "frmSupplier"
    ListView1.ListItems.Add(2).Text = "frmpermissions"
    ListView1.ListItems.Add(3).Text = "frmsupplierModify"
    is this the o/p that you want the code is in the Screenshot i have created a new form and added a listview1 control on it and than the code
    Attached Images Attached Images  

    Im Pro in C#,VB.NET,Batch,Socket Programming, SPY Software Programming, VB6, Win32Api, VBscript, Windows Registry, ASP.NET, PHP, Jquery, AJAX.

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