|
thanks u.i want that it can auto notify by birthday.
|
|
|
|
|
Then you must have a checking function 1 time / day. If birthday == DateTime.Now, then show notifyIcon.
|
|
|
|
|
sorry, i forgate to tell u that, my program is not run all time.. so how it possible.help me.
|
|
|
|
|
If your program is not running, then it is impossible to show notify icon. Just like outlook. If your outlook not running, then you cannot get message whether you get a new message or not.
|
|
|
|
|
how can i run a process when windows is start.thank for help.
|
|
|
|
|
Use System.Diagnostics.Process.Start(string filename);
for example : System.Diagnostics.Process.Start(@"C:\WINNT\NOTEPAD.EXE");
|
|
|
|
|
sorry here windows means operating system. so how can i run my program when os start.thanks.
|
|
|
|
|
You must copy your application to this directory :
C:\Documents and Settings\All Users\Start Menu\Programs\Startup
That directory is for all users. If you want to specific user only, then you must change "All User" to other user, for example (MyAccount):
C:\Documents and Settings\MyAccount\Start Menu\Programs\Startup
|
|
|
|
|
can i use windows service for that.thankxs.
|
|
|
|
|
can i use windows service for that than how. thanks.
|
|
|
|
|
It depends on your application. If you application is a service, then you must install it in services, set to automatic, then if you start your windows, it will be started automatically.
But I don't know how to install a service. Sorry.
|
|
|
|
|
|
You could have a look at this article. Tray Icon[^]
Tarakeshwar
MCP, CCIE Q(R&S)
Before you criticize someone, you should walk a mile in their shoes. That way, when you criticize them, you're a mile away and you have their shoes.
!sgub evah t'nseod margorP sihT ?sgub naem ayaddahW
|
|
|
|
|
I want to allow a user of my user control to overrule the default painting of my control through a Paint event handler. I was thinking along the lines of...
protected override void OnPaint(PaintEventArgs e)<br />
{<br />
if (this.Paint != null)
base.OnPaint(e);<br />
else<br />
this.MyDefaultPainting(e);<br />
}
This doesn't work because the Paint event belongs to the base class and my derived class can't access it (as far as I know). I don't want to create another drawing event next to the Paint event and I don't want a construction that to forces an override of MyDefaultPainting either. More importantly, I don't want my default drawing done in the first Paint event handler in line that may be followed by the user's to prevent redundant painting.
So, is there a way to see whether or not an event handler is attached to an event that is defined in a base class?
|
|
|
|
|
if(base.Paint!=null) //should work
All the best,
Martin
|
|
|
|
|
Nope. Same problem as if (this.Paint != null)
Thanks for the reply, though.
|
|
|
|
|
Can you tell me more about your constilation of the UserControl?
Does the base UserControl also override the OnPaint?
....
|
|
|
|
|
No, it doesn't. My control is the first to override this method.
|
|
|
|
|
Just for testing:
Have you tried to put the code in your base class?
|
|
|
|
|
I can't, it isn't mine. The base class is UserControl.
|
|
|
|
|
|
Same problem: not allowed. The event-wrapper prevents me from doing anything but adding or removing an event handler.
|
|
|
|
|
Use a little reflection to get the field which represents the Paint event, then (from within your control) access the protected Events property. Pass in the event field id and check if it returns null or not.
FieldInfo fi = typeof(Control).GetField( "EventPaint", BindingFlags.Static | BindingFlags.NonPublic );
object eventPaint = fi.GetValue( this );
this.Paint += new PaintEventHandler(Form1_Paint);
if( base.Events[eventPaint] == null )
{
Debug.WriteLine( "No handlers attached to the Paint event." );
}
else
{
Debug.WriteLine( "One or more handler is attached to the Paint event." );
}
:josh:
My WPF Blog[^]
|
|
|
|
|
Josh Smith wrote: Use a little reflection to get the field which represents the Paint event, then (from within your control) access the protected Events property.
This is exactly what I need! I knew of the Events property but didn't know where to get the key to retrieve the right event. Thanks, Josh.
|
|
|
|
|
Just define your own Paint event with the "new" keyword and add logic to "add" and "remove" accessors. For example:
<br />
private PaintEventHandler myPaint;<br />
<br />
public new event PaintEventHandler Paint<br />
{<br />
add<br />
{<br />
base.Paint += value;<br />
myPaint += value;<br />
}<br />
<br />
remove<br />
{<br />
base.Paint -= value;<br />
myPaint -= value;<br />
}<br />
}<br />
<br />
protected override void OnPaint(PaintEventArgs e)<br />
{<br />
if (myPaint != null)<br />
base.OnPaint(e);<br />
else<br />
MyDefaultPainting(e);<br />
}<br />
|
|
|
|