Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Listview in VB.Net

Listview in VB.Net

Scheduled Pinned Locked Moved Visual Basic
helpcsharpquestion
3 Posts 2 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    prathiba_naresh
    wrote on last edited by
    #1

    Hi All, I have a issue in pre-selecting the first item of the listview control before displaying the form. I have 2 forms. Form1 has a modify button and Form2 has a Listview control. When the modify button in Form1 is clicked, it should populate the Listview items for the control in form2 and before displaying the form2 the default selected item of the listview is set to item(0)(i.e the First item). I am able to populate the items and the problem occurs when i set the property the below said property. MaterialListView.Items(0).Selected = True it throws the below said error. An unhandled exception of type 'System.OutOfMemoryException' occurred in system.windows.forms.dll Additional information: Error creating window handle. Can someone help ? Thanks

    A 1 Reply Last reply
    0
    • P prathiba_naresh

      Hi All, I have a issue in pre-selecting the first item of the listview control before displaying the form. I have 2 forms. Form1 has a modify button and Form2 has a Listview control. When the modify button in Form1 is clicked, it should populate the Listview items for the control in form2 and before displaying the form2 the default selected item of the listview is set to item(0)(i.e the First item). I am able to populate the items and the problem occurs when i set the property the below said property. MaterialListView.Items(0).Selected = True it throws the below said error. An unhandled exception of type 'System.OutOfMemoryException' occurred in system.windows.forms.dll Additional information: Error creating window handle. Can someone help ? Thanks

      A Offline
      A Offline
      Andy Davies
      wrote on last edited by
      #2

      I have done somthing similar, here is the code i used to select an item: lstTracks.SetSelected(iSelected, True) iSelected is just an integer Hope that helps - Andy http://www.guardian.co.nr

      P 1 Reply Last reply
      0
      • A Andy Davies

        I have done somthing similar, here is the code i used to select an item: lstTracks.SetSelected(iSelected, True) iSelected is just an integer Hope that helps - Andy http://www.guardian.co.nr

        P Offline
        P Offline
        prathiba_naresh
        wrote on last edited by
        #3

        Hi Andy, Thanks for your reply. Actually i am using ListView so i don't see any property called Setselected. I think this property is for List box. Let me know if i have misunderstood anything. cheers

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups