Image list controls and image resources

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mark

    Image list controls and image resources

    Hi

    I notice that in some cases, to get an icon, an object (for example a list
    view) uses an image list, in others (e.g. a form) the image is selected from
    the project resources, i.e. a file.

    As I have images that I'd like to use in both situations I would like to use
    the same method for each. Preferably, as I find importing images as
    resources as often as not crashes VS, I would like to work with an image
    list.

    Anyone know if this is possible?

    Thanks in advance

    Mark
    PS Sorry if I completely missed something obvious...


  • Cor Ligthert [MVP]

    #2
    Re: Image list controls and image resources

    Mark,

    At least for me it is not clear what is the problem. Did you try it?

    Cor

    "Mark" <me@abc.comschr eef in bericht
    news:PZjQg.2967 0$cx.17040@news fe1-gui.ntli.net...
    Hi
    >
    I notice that in some cases, to get an icon, an object (for example a list
    view) uses an image list, in others (e.g. a form) the image is selected
    from the project resources, i.e. a file.
    >
    As I have images that I'd like to use in both situations I would like to
    use the same method for each. Preferably, as I find importing images as
    resources as often as not crashes VS, I would like to work with an image
    list.
    >
    Anyone know if this is possible?
    >
    Thanks in advance
    >
    Mark
    PS Sorry if I completely missed something obvious...
    >

    Comment

    • Mark

      #3
      Re: Image list controls and image resources

      Hi Cor

      Sorry I was a little vague... Basically there are 2 problems:

      1) I would like to contain all my icons in one image list that could be used
      for form icons (i.e. the one that appears in the title bar), as well as list
      and tree views etc. There appears to be no image list property for forms,
      the icon property being a file reference.

      2) When I import icons, as resources, to use as form icons VS crashes. On
      restarting it is ok and the icon is available, but its a slow crash nd a
      real time waster.

      I have a database which the users can assign icons to specific record types.
      I would like to use these icons both when the record is displayed in a
      treeview (for example) and as the forms icon when the record is opened. I
      would like both situations to use the same icon without having to keep an
      image list and folder full of icon resources synchronised some how.

      I hope this makes sense...?

      Cheers (and thanks)

      Mark

      "Cor Ligthert [MVP]" <notmyfirstname @planet.nlwrote in message
      news:Ony2ukT3GH A.988@TK2MSFTNG P02.phx.gbl...
      Mark,
      >
      At least for me it is not clear what is the problem. Did you try it?
      >
      Cor
      >
      "Mark" <me@abc.comschr eef in bericht
      news:PZjQg.2967 0$cx.17040@news fe1-gui.ntli.net...
      >Hi
      >>
      >I notice that in some cases, to get an icon, an object (for example a
      >list view) uses an image list, in others (e.g. a form) the image is
      >selected from the project resources, i.e. a file.
      >>
      >As I have images that I'd like to use in both situations I would like to
      >use the same method for each. Preferably, as I find importing images as
      >resources as often as not crashes VS, I would like to work with an image
      >list.
      >>
      >Anyone know if this is possible?
      >>
      >Thanks in advance
      >>
      >Mark
      >PS Sorry if I completely missed something obvious...
      >>
      >
      >

      Comment

      • Cor Ligthert [MVP]

        #4
        Re: Image list controls and image resources

        Mark,

        This is a question I have in my idea seen many times answered by Herfried,

        Can you search for yourself in these newsgroups threads where that was in.


        I hope this helps,

        Cor

        "Mark" <me@abc.comschr eef in bericht
        news:aTUQg.3145 2$cx.19168@news fe1-gui.ntli.net...
        Hi Cor
        >
        Sorry I was a little vague... Basically there are 2 problems:
        >
        1) I would like to contain all my icons in one image list that could be
        used for form icons (i.e. the one that appears in the title bar), as well
        as list and tree views etc. There appears to be no image list property for
        forms, the icon property being a file reference.
        >
        2) When I import icons, as resources, to use as form icons VS crashes. On
        restarting it is ok and the icon is available, but its a slow crash nd a
        real time waster.
        >
        I have a database which the users can assign icons to specific record
        types. I would like to use these icons both when the record is displayed
        in a treeview (for example) and as the forms icon when the record is
        opened. I would like both situations to use the same icon without having
        to keep an image list and folder full of icon resources synchronised some
        how.
        >
        I hope this makes sense...?
        >
        Cheers (and thanks)
        >
        Mark
        >
        "Cor Ligthert [MVP]" <notmyfirstname @planet.nlwrote in message
        news:Ony2ukT3GH A.988@TK2MSFTNG P02.phx.gbl...
        >Mark,
        >>
        >At least for me it is not clear what is the problem. Did you try it?
        >>
        >Cor
        >>
        >"Mark" <me@abc.comschr eef in bericht
        >news:PZjQg.296 70$cx.17040@new sfe1-gui.ntli.net...
        >>Hi
        >>>
        >>I notice that in some cases, to get an icon, an object (for example a
        >>list view) uses an image list, in others (e.g. a form) the image is
        >>selected from the project resources, i.e. a file.
        >>>
        >>As I have images that I'd like to use in both situations I would like to
        >>use the same method for each. Preferably, as I find importing images as
        >>resources as often as not crashes VS, I would like to work with an image
        >>list.
        >>>
        >>Anyone know if this is possible?
        >>>
        >>Thanks in advance
        >>>
        >>Mark
        >>PS Sorry if I completely missed something obvious...
        >>>
        >>
        >>
        >
        >

        Comment

        • Mark

          #5
          Re: Image list controls and image resources

          Thanks again Cor (and also thanks to Herfried)

          Managed to find the following (but haven't tried it yet)

          Dim ico As Icon

          Dim bmIcon As Bitmap = CType(ImageList 1.Images(0), Bitmap)

          ico = Icon.FromHandle (bmIcon.GetHico n)

          Me.Icon = ico

          Cheers

          Mark



          "Cor Ligthert [MVP]" <notmyfirstname @planet.nlwrote in message
          news:uByhDKt3GH A.1568@TK2MSFTN GP03.phx.gbl...
          Mark,
          >
          This is a question I have in my idea seen many times answered by Herfried,
          >
          Can you search for yourself in these newsgroups threads where that was in.

          >
          I hope this helps,
          >
          Cor
          >
          "Mark" <me@abc.comschr eef in bericht
          news:aTUQg.3145 2$cx.19168@news fe1-gui.ntli.net...
          >Hi Cor
          >>
          >Sorry I was a little vague... Basically there are 2 problems:
          >>
          >1) I would like to contain all my icons in one image list that could be
          >used for form icons (i.e. the one that appears in the title bar), as well
          >as list and tree views etc. There appears to be no image list property
          >for forms, the icon property being a file reference.
          >>
          >2) When I import icons, as resources, to use as form icons VS crashes. On
          >restarting it is ok and the icon is available, but its a slow crash nd a
          >real time waster.
          >>
          >I have a database which the users can assign icons to specific record
          >types. I would like to use these icons both when the record is displayed
          >in a treeview (for example) and as the forms icon when the record is
          >opened. I would like both situations to use the same icon without having
          >to keep an image list and folder full of icon resources synchronised some
          >how.
          >>
          >I hope this makes sense...?
          >>
          >Cheers (and thanks)
          >>
          >Mark
          >>
          >"Cor Ligthert [MVP]" <notmyfirstname @planet.nlwrote in message
          >news:Ony2ukT3G HA.988@TK2MSFTN GP02.phx.gbl...
          >>Mark,
          >>>
          >>At least for me it is not clear what is the problem. Did you try it?
          >>>
          >>Cor
          >>>
          >>"Mark" <me@abc.comschr eef in bericht
          >>news:PZjQg.29 670$cx.17040@ne wsfe1-gui.ntli.net...
          >>>Hi
          >>>>
          >>>I notice that in some cases, to get an icon, an object (for example a
          >>>list view) uses an image list, in others (e.g. a form) the image is
          >>>selected from the project resources, i.e. a file.
          >>>>
          >>>As I have images that I'd like to use in both situations I would like
          >>>to use the same method for each. Preferably, as I find importing images
          >>>as resources as often as not crashes VS, I would like to work with an
          >>>image list.
          >>>>
          >>>Anyone know if this is possible?
          >>>>
          >>>Thanks in advance
          >>>>
          >>>Mark
          >>>PS Sorry if I completely missed something obvious...
          >>>>
          >>>
          >>>
          >>
          >>
          >
          >

          Comment

          Working...