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. C#
  4. Getting Icon Name from notifyIcon1

Getting Icon Name from notifyIcon1

Scheduled Pinned Locked Moved C#
question
3 Posts 3 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.
  • C Offline
    C Offline
    cbmdk
    wrote on last edited by
    #1

    Hi there, I'm in a bad situation I think. I have to do something according to what icon has been set in my notifyicon1. this is the way I have added the icon to the notifyIcon. notifyIcon1.Icon = new Icon(GetType(),"red.ico"); I have to fire an event only when the icon is different from red.ico, How can i do this? :confused::confused::confused: The solution might be simple, but I just can't figure it out looking forward to your response. regards Christian

    D M 2 Replies Last reply
    0
    • C cbmdk

      Hi there, I'm in a bad situation I think. I have to do something according to what icon has been set in my notifyicon1. this is the way I have added the icon to the notifyIcon. notifyIcon1.Icon = new Icon(GetType(),"red.ico"); I have to fire an event only when the icon is different from red.ico, How can i do this? :confused::confused::confused: The solution might be simple, but I just can't figure it out looking forward to your response. regards Christian

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      The icon should only be used to show the user a status of an internal variable, not as a method of passing data from one part of your program to another. If the icon is red, it's because something else in your application set it that way. A better solution would be to set up a property in your app that sets a value that can be used elsewhere in your app and at the same time changes the icon to reflect the value of that property. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

      1 Reply Last reply
      0
      • C cbmdk

        Hi there, I'm in a bad situation I think. I have to do something according to what icon has been set in my notifyicon1. this is the way I have added the icon to the notifyIcon. notifyIcon1.Icon = new Icon(GetType(),"red.ico"); I have to fire an event only when the icon is different from red.ico, How can i do this? :confused::confused::confused: The solution might be simple, but I just can't figure it out looking forward to your response. regards Christian

        M Offline
        M Offline
        Mike Dimmick
        wrote on last edited by
        #3

        Store another variable elsewhere which tells you which icon is selected. This will also protect you against changes to the icon name, how it's stored, etc. Stability. What an interesting concept. -- Chris Maunder

        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