NotifyIcon's Icon from Form

Discussion in 'Questions (Windows Mobile)' started by Zenerdiode, Aug 9, 2009.

  1. Zenerdiode

    Zenerdiode Active Member Licensed User

    I'm using Agraham's ControlsExDesktop and the NotifyIcon within. The icon I would like to use with NotifyIcon is the same as the Form's icon. Is there a way to reference this icon rather than having to provide a discrete icon file?

    I've tried adding the icon to an ImageList control and using that as a reference but I can't get that to work. I appreciate ContolsExDeskop has an IconList but I'd like to be able to embed the icon to use with NotifyIcon.

    Turning this last item into a Wishlist, if an IconList was embeddable, you would be able to 'animate' the NotifyIcon as many programs do.
     
  2. Zenerdiode

    Zenerdiode Active Member Licensed User

    Am I able to get the Form's Icon, with GetProperty in Door? (System.Windows.Forms.Form.Icon Property) Then use SetProperty to set that reference to the NotifyIcon's NotifyIcon.Icon property?
     
  3. Zenerdiode

    Zenerdiode Active Member Licensed User

    I can. This seems to work. NotifyIcon is an object from ControlsExDesktop and Obj is an object from door:

    Code:
    Sub App_Start
       Obj.New1(
    False)
       Obj.FromControl(
    "Form1")
       NotifyIcon.New1(
    "Form1",AppPath&"\MyIcon.ico")
       [COLOR=
    "Red"]NotifyIcon.Icon=Obj.GetProperty("Icon")[/COLOR]
       Form1.Show
       NotifyIcon.Visible=
    True
    End Sub
    Andrew, may I suggest a 'New2' for ControlsExDesktop's NotifyIcon, whereby you may use the Form's icon without having to load an external one from file (using something similar to the above in the dll) please?
     
  4. agraham

    agraham Expert Licensed User

  5. Zenerdiode

    Zenerdiode Active Member Licensed User

    My hat is off! Thank You :)
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice