CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6

Threaded View

  1. #1
    Join Date
    Sep 2012
    Posts
    10

    How Is This Method Working?!

    I am using the compare() method to check a saved date and time in a variable by the user VS the system's current time, "Now". The compare() method return -1 if the first date and time is less than the current time, or 0 if the saved date and time is equal to the current time. How is it working (making the application visible when the times are equal) if it's returning -1 from what I can see in the code.

    private void timer1_Tick(object sender, EventArgs e)
    {
    if (remindTime.CompareTo(DateTime.Now) < 0) //when the dates are equal it should return 0 so this.Visible = true; will not run, but it does.
    {
    this.Visible = true;
    }
    }


    Thank you all in advance!
    Last edited by Fanatic2012; September 7th, 2012 at 02:02 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured