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. Assiging AxImageList to AxListView

Assiging AxImageList to AxListView

Scheduled Pinned Locked Moved Visual Basic
csharphelptutorial
6 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.
  • A Offline
    A Offline
    AR Reddy
    wrote on last edited by
    #1

    Hi, When I tried to assign AxImageList to AxListView, I am getting "Invalid Object" error. Could any one of you please let me know how to do this. My code: Private WithEvents mLV As AxMSComctlLib.AxListView Public WithEvents imlLVSortIcons As AxMSComctlLib.AxImageList mLV.ColumnHeaderIcons = frmMain.DefInstance.imlLVSortIcons Actually this code is converted from VB6 to VB.NET. Thanks in Advance,

    AR Reddy

    N 1 Reply Last reply
    0
    • A AR Reddy

      Hi, When I tried to assign AxImageList to AxListView, I am getting "Invalid Object" error. Could any one of you please let me know how to do this. My code: Private WithEvents mLV As AxMSComctlLib.AxListView Public WithEvents imlLVSortIcons As AxMSComctlLib.AxImageList mLV.ColumnHeaderIcons = frmMain.DefInstance.imlLVSortIcons Actually this code is converted from VB6 to VB.NET. Thanks in Advance,

      AR Reddy

      N Offline
      N Offline
      nlarson11
      wrote on last edited by
      #2

      Private WithEvents mLV As ??? AxMSComctlLib.AxListView mLV.ColumnHeaderIcons = frmMain.DefInstance.imlLVSortIcons In the first line, you never create a new instance of mLV that's why you can't assign anything to one of it's properties. Replace ??? with New

      'Never argue with an idiot; they'll drag you down to their level and beat you with experience.' ~ anonymous 'Life's real failure is when you do not realize how close you were to success when you gave up.' ~ anonymous

      A 1 Reply Last reply
      0
      • N nlarson11

        Private WithEvents mLV As ??? AxMSComctlLib.AxListView mLV.ColumnHeaderIcons = frmMain.DefInstance.imlLVSortIcons In the first line, you never create a new instance of mLV that's why you can't assign anything to one of it's properties. Replace ??? with New

        'Never argue with an idiot; they'll drag you down to their level and beat you with experience.' ~ anonymous 'Life's real failure is when you do not realize how close you were to success when you gave up.' ~ anonymous

        A Offline
        A Offline
        AR Reddy
        wrote on last edited by
        #3

        Hi, Thanks for the reply, I have tried with New, but I am getting the same error "Invalid Object".

        AR Reddy

        N 1 Reply Last reply
        0
        • A AR Reddy

          Hi, Thanks for the reply, I have tried with New, but I am getting the same error "Invalid Object".

          AR Reddy

          N Offline
          N Offline
          nlarson11
          wrote on last edited by
          #4

          Ok let's look at the code you gave Private WithEvents mLV As AxMSComctlLib.AxListView Public WithEvents imlLVSortIcons As AxMSComctlLib.AxImageList mLV.ColumnHeaderIcons = frmMain.DefInstance.imlLVSortIcons 1) the new is required for mLV so put that back in. 2) You aren't using imlLVsortIcons is that your intention? 3) which form are you in because you mention a form frmmain? 4) is definstance of frmmain created?

          'Never argue with an idiot; they'll drag you down to their level and beat you with experience.' ~ anonymous 'Life's real failure is when you do not realize how close you were to success when you gave up.' ~ anonymous

          A 1 Reply Last reply
          0
          • N nlarson11

            Ok let's look at the code you gave Private WithEvents mLV As AxMSComctlLib.AxListView Public WithEvents imlLVSortIcons As AxMSComctlLib.AxImageList mLV.ColumnHeaderIcons = frmMain.DefInstance.imlLVSortIcons 1) the new is required for mLV so put that back in. 2) You aren't using imlLVsortIcons is that your intention? 3) which form are you in because you mention a form frmmain? 4) is definstance of frmmain created?

            'Never argue with an idiot; they'll drag you down to their level and beat you with experience.' ~ anonymous 'Life's real failure is when you do not realize how close you were to success when you gave up.' ~ anonymous

            A Offline
            A Offline
            AR Reddy
            wrote on last edited by
            #5

            Hi nlarson, Many thanks for the replies, Here is my actual code, Private WithEvents mLV As AxMSComctlLib.AxListView Public Sub Constructor(ByRef LV As AxMSComctlLib.AxListView, Optional ByRef LVWrapper As cListViewWrapper = Nothing) mLV = LV ...... mLV.ColumnHeaderIcons = frmMain.DefInstance.imlLVSortIcons ...... ...... End Sub 1) i can put back the New for mLV 2) Yes, im not using imlVVSortIcons in this form, i want to use mLV 3) frmMain is the main form which contains the imlLVSortIcons image list. And the above code is in different form. 4) Yes, I have created the definstance in frmMain. Thanks,

            AR Reddy

            N 1 Reply Last reply
            0
            • A AR Reddy

              Hi nlarson, Many thanks for the replies, Here is my actual code, Private WithEvents mLV As AxMSComctlLib.AxListView Public Sub Constructor(ByRef LV As AxMSComctlLib.AxListView, Optional ByRef LVWrapper As cListViewWrapper = Nothing) mLV = LV ...... mLV.ColumnHeaderIcons = frmMain.DefInstance.imlLVSortIcons ...... ...... End Sub 1) i can put back the New for mLV 2) Yes, im not using imlVVSortIcons in this form, i want to use mLV 3) frmMain is the main form which contains the imlLVSortIcons image list. And the above code is in different form. 4) Yes, I have created the definstance in frmMain. Thanks,

              AR Reddy

              N Offline
              N Offline
              nlarson11
              wrote on last edited by
              #6

              is typeof(columnheadericons) = imllvsorticons? if your getting somekind of object not set then you'll need to check each one If lv is nothing then msgbox("it's lv") If frmmain is nothing then msgbox("it's frmmain") If frmmain.definstance is nothing then msgbox("it's frmmain.definstance") otherwise ????????????

              'Never argue with an idiot; they'll drag you down to their level and beat you with experience.' ~ anonymous 'Life's real failure is when you do not realize how close you were to success when you gave up.' ~ anonymous

              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