Click here to Skip to main content
15,900,973 members
Home / Discussions / Visual Basic
   

Visual Basic

 
RantRe: Need to detect toolbar button click in 3rd party app Pin
εїзεїзεїз3-May-10 10:00
εїзεїзεїз3-May-10 10:00 
GeneralRe: Need to detect toolbar button click in 3rd party app Pin
drh65584-May-10 5:38
drh65584-May-10 5:38 
GeneralRe: Need to detect toolbar button click in 3rd party app Pin
εїзεїзεїз4-May-10 19:37
εїзεїзεїз4-May-10 19:37 
GeneralRe: Need to detect toolbar button click in 3rd party app Pin
drh65585-May-10 6:14
drh65585-May-10 6:14 
QuestionProblem in setting DateTime value explicitly. Pin
priyamtheone1-May-10 6:31
priyamtheone1-May-10 6:31 
AnswerRe: Problem in setting DateTime value explicitly. Pin
Luc Pattyn1-May-10 6:54
sitebuilderLuc Pattyn1-May-10 6:54 
AnswerRe: Problem in setting DateTime value explicitly. Pin
Andy_L_J1-May-10 13:01
Andy_L_J1-May-10 13:01 
QuestionProblem with DateTime matching. Pin
priyamtheone1-May-10 6:31
priyamtheone1-May-10 6:31 
I'm trying to match a certain DateTime value with the current system DateTime. I have a timer and a label on a form. Timer interval is set to 1000. When the form loads, the timer starts ticking. As soon as the current DateTime matches the value of the variable, it shows a message in the label.

When I'm writing the following code, the values don't match even if the current system DateTime is equal to the variable. Label1 isn't showing 'Times Matched':

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Dim dtmNow As DateTime
dim dtmVar as DateTime=#04/28/2010 03:25:00 AM#

dtmNow = Now
If dtmVar = dtmNow Then Label1.Text = "Times Matched"
End Sub

But when I'm writing the same code by parsing 'Now' into DateTime it's working fine.

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Dim dtmNow As DateTime
dim dtmVar as DateTime=#04/28/2010 03:25:00 AM#

dtmNow = DateTime.Parse(Now.ToString)
If dtmVar = dtmNow Then Label1.Text = "Times Matched"
End Sub

Why is it so? The default format of 'Now' is the same as I have stored in dtmVar variable. So there's no question of format mismatch. Does that mean 'Now' is not actually a DateTime property?
Provided, my O.S. is Windows Vista Ultimate and all date/time settings are set to default.
Regards.
AnswerRe: Problem with DateTime matching. Pin
Luc Pattyn1-May-10 6:48
sitebuilderLuc Pattyn1-May-10 6:48 
QuestionCheck the entrances to the keyboard and clean the buffer Pin
yera200230-Apr-10 11:38
yera200230-Apr-10 11:38 
AnswerRe: Check the entrances to the keyboard and clean the buffer Pin
Dave Kreskowiak30-Apr-10 17:48
mveDave Kreskowiak30-Apr-10 17:48 
QuestionConvert from decimal to hexidecimal? Pin
Adam Wike30-Apr-10 3:48
Adam Wike30-Apr-10 3:48 
AnswerRe: Convert from decimal to hexidecimal? Pin
Dave Kreskowiak30-Apr-10 3:58
mveDave Kreskowiak30-Apr-10 3:58 
AnswerRe: Convert from decimal to hexidecimal? [modified] Pin
Dalek Dave30-Apr-10 4:00
professionalDalek Dave30-Apr-10 4:00 
GeneralRe: Convert from decimal to hexidecimal? Pin
DaveAuld30-Apr-10 4:19
professionalDaveAuld30-Apr-10 4:19 
GeneralRe: Convert from decimal to hexidecimal? Pin
Dalek Dave30-Apr-10 4:23
professionalDalek Dave30-Apr-10 4:23 
GeneralRe: Convert from decimal to hexidecimal? Pin
DaveAuld30-Apr-10 4:28
professionalDaveAuld30-Apr-10 4:28 
GeneralRe: Convert from decimal to hexidecimal? Pin
Adam Wike1-May-10 13:32
Adam Wike1-May-10 13:32 
QuestionDynamically adding tool strip buttons [modified] Pin
MacRaider430-Apr-10 2:54
MacRaider430-Apr-10 2:54 
AnswerRe: Dynamically adding tool strip buttons Pin
Simon_Whale30-Apr-10 3:17
Simon_Whale30-Apr-10 3:17 
GeneralRe: Dynamically adding tool strip buttons Pin
MacRaider430-Apr-10 3:39
MacRaider430-Apr-10 3:39 
GeneralRe: Dynamically adding tool strip buttons Pin
MacRaider430-Apr-10 3:49
MacRaider430-Apr-10 3:49 
AnswerRe: Dynamically adding tool strip buttons Pin
Wayne Gaylard30-Apr-10 3:56
professionalWayne Gaylard30-Apr-10 3:56 
GeneralRe: Dynamically adding tool strip buttons Pin
MacRaider430-Apr-10 6:44
MacRaider430-Apr-10 6:44 
GeneralRe: Dynamically adding tool strip buttons Pin
Wayne Gaylard30-Apr-10 15:11
professionalWayne Gaylard30-Apr-10 15:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.