Imports System.some.stuff.here
Namespace MyNotify
Public Class MyNotify
Implements IDisposable
private withevents noti as System.Windows.Forms.NotifyIcon
Public Sub New()
End Sub
Public Property Visible() as Boolean
Get
return noti.Visible
End Get
Set
noti.Visible = value
End Set
End Property
Public Property Text() As String
Get
Return noti.Text
End Get
Set
noti.Text = Value
End Set
End Property
Public ReadOnly Property About() As String
Get
return "By Taximania"
End Get
End Property
Public Property Icon() As String
Get
return noti.IconPath
End Get
Set
noti.IconPath = Value
End Set
End Property
Public ReadOnly Property DllVer() As String
Get
return "Ver 1.00"
End Get
End Property
Public Sub Dispose() Implements System.IDisposable.Dispose
If Not noti Is Nothing Then
noti.Dispose()
End If
End Sub
End Class
End Namespace
Icon.Text should be Icon.ContextMenu etc.
Icon.Click (not shown above) toggle's the icon image.
I want to have an app running in the background and toggle it's
on/off status by clicking the NotifyIcon.
(Don't we all)
I've googled and looked into this for the past 2 weeks but
can't get a compiled dll to work :sign0137:
Look at the .cs source file for ControlsExDesktop http://www.b4x.com/forum/additional...top-controlsexdesktop-libraries.html#post8248 to see how to implement NotifyIcon in a library. It's in C# but hopefully you will get the idea. Basically you need to hook into at least the NotifyIcon Click event, there are others as well, to know when the user interacts with the NotifyIcon. Ignore the Form Resize event code in the source, it is there for convenience for use with a FormEx and is not necessary to use a NotifyIcon although it is useful to be able to know when a forms state changes.
For VB code that shows how to catch a ScrollBar control event and pass it to Basic4ppc see post #3 here http://www.b4x.com/forum/code-samples-tips/35-how-create-basic4ppc-library.html. There is a C# version in post #1 so if you compare the ScrollBar VB and C# code you should be able to understand my NotifyIcon C# code for the Click event. Essentially the difference is that VB declares a control "WithEvents" then uses "Handles" to attach the event procedures. C# has no equivalen to "WithEvents", you add each individual event to the required event property of the control.
Thar's because NotifyIcon is a desktop only control and doesn't exist on the device. The somewhat limited device "equivalent" (it's not really) is Notifier.
That's because NotifyIcon is a desktop only control and doesn't exist on the device. The somewhat limited device "equivalent" (it's not really) is Notifier.
Mmm, that sort of explains me wasting my time :sign0148:
But, due to no work today, 'snowed in'
I've managed to knock up a proper system notification popup window .dll written with C# and Vis Studio 2005 pro
I'm impressed with myself and will post it on a new thread when I've
sorted a couple of bugs.
I've managed to knock up a proper system notification popup window .dll written with C# and Vis Studio 2005 pro
I'm impressed with myself and will post it on a new thread when I've
sorted a couple of bugs.