NotifyIcon's Icon from Form

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.
 

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?
 

Zenerdiode

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

B4X:
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?
 
Top