473,398 Members | 2,335 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

DateTime - Misusing Greater Than?

I was trying to make a quick 5 minute app to remind me to do something
before leaving work - just have the dialog appear which showed in the
quicklaunch bar.

The application hung (which was unfortunate as I had set it as a startup
and had some difficulty deleting the link with the CPU at 100%)

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace Warn5 {
public partial class Form1 : Form {
DateTime p = new DateTime(2008, 1, 1, 17, 0, 0);
public Form1() {
InitializeComponent();
while (DateTime.Now p)
p.AddDays(1);
}

private void timer1_Tick(object sender, EventArgs e) {
if (DateTime.Now p) {
this.WindowState = FormWindowState.Normal;
this.BringToFront();
while (DateTime.Now p)
p.AddDays(1);
}
}

private void notifyIcon1_MouseDoubleClick(object sender,
MouseEventArgs e) {
this.WindowState = FormWindowState.Normal;

}
}
}
--
Alex Taylor
Jan 5 '08 #1
2 1516
On Fri, 04 Jan 2008 17:41:02 -0800, Luc The Perverse
<ataylor_no_spa_am@_letterC_solutions.n3twrote:
I was trying to make a quick 5 minute app to remind me to do something
before leaving work - just have the dialog appear which showed in the
quicklaunch bar.

The application hung (which was unfortunate as I had set it as a startup
and had some difficulty deleting the link with the CPU at 100%)
Instead of "p.AddDays(1)", try "p = p.AddDays(1)".

Also, next time you've got a process hogging the CPU, a fast way to get
control back is to bring up the Task Manager (Ctrl-Shift-Esc) and
right-click on the process so that you can lower the priority and/or kill
the process. Task Manager is reasonably lightweight and you can often
control the process externally faster than you can get the process itself
to respond (especially if your process is stuck in a loop preventing it
from actually processing any events :) ).

Pete
Jan 5 '08 #2
Peter Duniho wrote:
On Fri, 04 Jan 2008 17:41:02 -0800, Luc The Perverse
<ataylor_no_spa_am@_letterC_solutions.n3twrote:
>I was trying to make a quick 5 minute app to remind me to do something
before leaving work - just have the dialog appear which showed in the
quicklaunch bar.

The application hung (which was unfortunate as I had set it as a
startup and had some difficulty deleting the link with the CPU at 100%)

Instead of "p.AddDays(1)", try "p = p.AddDays(1)".
LOL. Why - in retrospect, I suppose that does make a little sense :)
Also, next time you've got a process hogging the CPU, a fast way to get
control back is to bring up the Task Manager (Ctrl-Shift-Esc) and
right-click on the process so that you can lower the priority and/or
kill the process. Task Manager is reasonably lightweight and you can
often control the process externally faster than you can get the process
itself to respond (especially if your process is stuck in a loop
preventing it from actually processing any events :) ).
Hmmm - COOL. I haven't known how to get to it directly since I switched
to XP Pro - I was so used to pushing Ctrl Alt Delete and then clicking
task manager (or whatever it is.)

Thank you very much sir!

--
LTP

:)
Jan 5 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: colinhumber | last post by:
I have a datetime variable coming from my ASP.NET application that has a time portion. I give my users the option to perform an equals, greater than, less than, or between comparison. The trouble...
13
by: bredal Jensen | last post by:
Hello gurus, I'm building a small booking system and i have come accross quiet a tedious pitfall. "I need to make sure that people do not book for tomorrow when todays time is greater or...
3
by: Tim Cowan | last post by:
Hi, In my application I need to compare whether one time is greater than another. What I am doing right now is taking the current datetime, formatting as string without the time element, and...
8
by: ajs | last post by:
I have a process that verifies that a server is running. If the server stops responding I send an email to a support person. Now I want to add a downtime indicator so that my code does not send...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.