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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. Visual Basic
  4. listview smallimages disappear

listview smallimages disappear

Scheduled Pinned Locked Moved Visual Basic
graphicshelp
7 Posts 2 Posters 0 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.
  • E Offline
    E Offline
    ESTAN
    wrote on last edited by
    #1

    Hello, I encounter strange phenomenon with my listview and smallimages. The images disappear and don't come back, even after reboot, run the application on a different machine. If i create a new listview, it works again for a while. Does anyone can help me with this annoying thing. The imagelist has 2 images and when i replace the listview i reuse it. Here you have my code, first the declaration of the listview, and second, how i add during the program one element. Thanks for to take a look into this. Declaration: ' 'ListView2 ' Me.ListView2.AccessibleDescription = resources.GetString("ListView2.AccessibleDescription") Me.ListView2.AccessibleName = resources.GetString("ListView2.AccessibleName") Me.ListView2.Alignment = CType(resources.GetObject("ListView2.Alignment"), System.Windows.Forms.ListViewAlignment) Me.ListView2.Anchor = CType(resources.GetObject("ListView2.Anchor"), System.Windows.Forms.AnchorStyles) Me.ListView2.BackgroundImage = CType(resources.GetObject("ListView2.BackgroundImage"), System.Drawing.Image) Me.ListView2.Columns.AddRange(New System.Windows.Forms.ColumnHeader() {Me.clh_1, Me.clh_2, Me.clh_3, Me.clh_4, Me.clh_5, Me.clh_6, Me.clh_7, Me.clh_8, Me.clh_9, Me.clh_10}) Me.ListView2.Dock = CType(resources.GetObject("ListView2.Dock"), System.Windows.Forms.DockStyle) Me.ListView2.Enabled = CType(resources.GetObject("ListView2.Enabled"), Boolean) Me.ListView2.Font = CType(resources.GetObject("ListView2.Font"), System.Drawing.Font) Me.ListView2.FullRowSelect = True Me.ListView2.GridLines = True Me.ListView2.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable Me.ListView2.ImeMode = CType(resources.GetObject("ListView2.ImeMode"), System.Windows.Forms.ImeMode) Me.ListView2.LabelWrap = CType(resources.GetObject("ListView2.LabelWrap"), Boolean) Me.ListView2.LargeImageList = Me.ImageList1 Me.ListView2.Location = CType(resources.GetObject("ListView2.Location"), System.Drawing.Point) Me.ListView2.Name = "ListView2" Me.ListView2.RightToLeft = CType(resources.GetObject("ListView2.RightToLeft"), System.Windows.Forms.RightToLeft) Me.ListView2.Size = CType(resources.GetObject("ListView2.Size"), System.Drawing.Size) Me.ListView2.SmallImageList = Me.ImageList1 Me.ListView2.TabIndex = CType(resources.GetObject("ListView2.TabIndex"), Integer) Me.ListView2.Text = resources.GetString("Li

    T 1 Reply Last reply
    0
    • E ESTAN

      Hello, I encounter strange phenomenon with my listview and smallimages. The images disappear and don't come back, even after reboot, run the application on a different machine. If i create a new listview, it works again for a while. Does anyone can help me with this annoying thing. The imagelist has 2 images and when i replace the listview i reuse it. Here you have my code, first the declaration of the listview, and second, how i add during the program one element. Thanks for to take a look into this. Declaration: ' 'ListView2 ' Me.ListView2.AccessibleDescription = resources.GetString("ListView2.AccessibleDescription") Me.ListView2.AccessibleName = resources.GetString("ListView2.AccessibleName") Me.ListView2.Alignment = CType(resources.GetObject("ListView2.Alignment"), System.Windows.Forms.ListViewAlignment) Me.ListView2.Anchor = CType(resources.GetObject("ListView2.Anchor"), System.Windows.Forms.AnchorStyles) Me.ListView2.BackgroundImage = CType(resources.GetObject("ListView2.BackgroundImage"), System.Drawing.Image) Me.ListView2.Columns.AddRange(New System.Windows.Forms.ColumnHeader() {Me.clh_1, Me.clh_2, Me.clh_3, Me.clh_4, Me.clh_5, Me.clh_6, Me.clh_7, Me.clh_8, Me.clh_9, Me.clh_10}) Me.ListView2.Dock = CType(resources.GetObject("ListView2.Dock"), System.Windows.Forms.DockStyle) Me.ListView2.Enabled = CType(resources.GetObject("ListView2.Enabled"), Boolean) Me.ListView2.Font = CType(resources.GetObject("ListView2.Font"), System.Drawing.Font) Me.ListView2.FullRowSelect = True Me.ListView2.GridLines = True Me.ListView2.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable Me.ListView2.ImeMode = CType(resources.GetObject("ListView2.ImeMode"), System.Windows.Forms.ImeMode) Me.ListView2.LabelWrap = CType(resources.GetObject("ListView2.LabelWrap"), Boolean) Me.ListView2.LargeImageList = Me.ImageList1 Me.ListView2.Location = CType(resources.GetObject("ListView2.Location"), System.Drawing.Point) Me.ListView2.Name = "ListView2" Me.ListView2.RightToLeft = CType(resources.GetObject("ListView2.RightToLeft"), System.Windows.Forms.RightToLeft) Me.ListView2.Size = CType(resources.GetObject("ListView2.Size"), System.Drawing.Size) Me.ListView2.SmallImageList = Me.ImageList1 Me.ListView2.TabIndex = CType(resources.GetObject("ListView2.TabIndex"), Integer) Me.ListView2.Text = resources.GetString("Li

      T Offline
      T Offline
      Tom Deketelaere
      wrote on last edited by
      #2

      I don't immidiatly know why you're images disapear but I'd start by trying to figure out when exactly they disapear (after a specific action or time) also try triming you're code to the minimum (perhaps even rewrite some in a differant project and see if the same happens there) since I'v never encountered this before (and I'v used listviews with images a few times before) I would think that somewhere in you're code there is a mistake that clears the images from the listview or the images from the imagelist so I'm afraid this might be one of those trial and error debugging things

      E 1 Reply Last reply
      0
      • T Tom Deketelaere

        I don't immidiatly know why you're images disapear but I'd start by trying to figure out when exactly they disapear (after a specific action or time) also try triming you're code to the minimum (perhaps even rewrite some in a differant project and see if the same happens there) since I'v never encountered this before (and I'v used listviews with images a few times before) I would think that somewhere in you're code there is a mistake that clears the images from the listview or the images from the imagelist so I'm afraid this might be one of those trial and error debugging things

        E Offline
        E Offline
        ESTAN
        wrote on last edited by
        #3

        Do you think that all these lines are normal? For example: CType(resources.GetObject("ListView2.Dock"), System.Windows.Forms.DockStyle) It is referring to the resources file, I am a C# programmer, but I have to make something in vb.net and in .NET 1.1, so I am using VS2003. I never saw this before. Another, if I change the listview, i have images for a while and than it falls back to its old habit. This sucks. I'll try to figure out what is causing this problem.

        T 1 Reply Last reply
        0
        • E ESTAN

          Do you think that all these lines are normal? For example: CType(resources.GetObject("ListView2.Dock"), System.Windows.Forms.DockStyle) It is referring to the resources file, I am a C# programmer, but I have to make something in vb.net and in .NET 1.1, so I am using VS2003. I never saw this before. Another, if I change the listview, i have images for a while and than it falls back to its old habit. This sucks. I'll try to figure out what is causing this problem.

          T Offline
          T Offline
          Tom Deketelaere
          wrote on last edited by
          #4

          did you import you form or did you start from scratch, added the listview, set its properties,...? it is possible that you get strange code like that from the designer when importing a form or when copying a control (I don't know why or how but it doesn't always work) if you did copy it or import it I would suggest you make a new project and start from scratch there (not you whole prog just the bit with the lisview code) and see if you still have the behavior you described if so then something is probebly wrong with the code if you don't get that behavior and you copyed it or imported it then that is probably the reason if you could providy more detail about all this I might be able to reproduce the behavior and help you further

          E 1 Reply Last reply
          0
          • T Tom Deketelaere

            did you import you form or did you start from scratch, added the listview, set its properties,...? it is possible that you get strange code like that from the designer when importing a form or when copying a control (I don't know why or how but it doesn't always work) if you did copy it or import it I would suggest you make a new project and start from scratch there (not you whole prog just the bit with the lisview code) and see if you still have the behavior you described if so then something is probebly wrong with the code if you don't get that behavior and you copyed it or imported it then that is probably the reason if you could providy more detail about all this I might be able to reproduce the behavior and help you further

            E Offline
            E Offline
            ESTAN
            wrote on last edited by
            #5

            Well what i do is i drag a listview from the toolbox on the form, set the options that i like one by one, and between I run my code in order to see where it goes wrong. And the conclusion is that i arrive to what I would like to have and the images are there. In the meanwhile i am creating other classes, not really working on that form, and on a sudden debugging the images are disappearing. Pff, I don't know what is going on.

            T 1 Reply Last reply
            0
            • E ESTAN

              Well what i do is i drag a listview from the toolbox on the form, set the options that i like one by one, and between I run my code in order to see where it goes wrong. And the conclusion is that i arrive to what I would like to have and the images are there. In the meanwhile i am creating other classes, not really working on that form, and on a sudden debugging the images are disappearing. Pff, I don't know what is going on.

              T Offline
              T Offline
              Tom Deketelaere
              wrote on last edited by
              #6

              Then I'm afraid I'm at a lose aswel the code you pasted above shouldn't have been generated if you draged it from the toolbox (there should have been a very differant looking code) all I can think of is recoding that part :sigh: (delete the listview and put it back set its properys, name it the same as before so that you're code still works) sorry I couldn't be more helpfull

              E 1 Reply Last reply
              0
              • T Tom Deketelaere

                Then I'm afraid I'm at a lose aswel the code you pasted above shouldn't have been generated if you draged it from the toolbox (there should have been a very differant looking code) all I can think of is recoding that part :sigh: (delete the listview and put it back set its properys, name it the same as before so that you're code still works) sorry I couldn't be more helpfull

                E Offline
                E Offline
                ESTAN
                wrote on last edited by
                #7

                Well, i am perplex myself also. I go to finish the application and recreate it from scratch, because i don't know what is going on. Damn, i wish i could program in VS2005 :-) Thanks anyway for looking at my problem.

                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