Click here to Skip to main content
16,008,075 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Timer set time click Pin
Johan Hakkesteegt3-Sep-09 0:32
Johan Hakkesteegt3-Sep-09 0:32 
GeneralRe: Timer set time click Pin
Bob Beaubien3-Sep-09 2:49
Bob Beaubien3-Sep-09 2:49 
GeneralRe: Timer set time click Pin
Johan Hakkesteegt3-Sep-09 3:31
Johan Hakkesteegt3-Sep-09 3:31 
GeneralRe: Timer set time click Pin
Bob Beaubien3-Sep-09 3:40
Bob Beaubien3-Sep-09 3:40 
GeneralRe: Timer set time click [modified] Pin
Bob Beaubien3-Sep-09 15:15
Bob Beaubien3-Sep-09 15:15 
GeneralRe: Timer set time click Pin
Johan Hakkesteegt3-Sep-09 20:12
Johan Hakkesteegt3-Sep-09 20:12 
GeneralRe: Timer set time click [modified] Pin
Bob Beaubien4-Sep-09 4:32
Bob Beaubien4-Sep-09 4:32 
GeneralRe: Timer set time click Pin
Johan Hakkesteegt6-Sep-09 20:05
Johan Hakkesteegt6-Sep-09 20:05 
Hi Bob,

Bob Beaubien wrote:
why did you put the mins at 23 ?

I understood from your question that you need your application to run once an hour but at different minutes. So for example at 0:10, 1:23, 2:15, etc. Ofcourse I don't know what those minutes are, so I just put 23 as an example. That is why I said that you may have to change these minutes to fit your needs.

Perhaps I misunderstood what it is exactly that you are trying to achieve.

Bob Beaubien wrote:
i have to put end if after each msg box right?

Actually no. The If statement allows for several different syntaxes:
If i = 1 Then MsgBox("Papa fume une pipe")

If i = 1 Then MsgBox("Papa fume une pipe") Else MsgBox("Mama fume le pipe de papa")

If i = 1 Then
    MsgBox("Papa fume une pipe")
Else : MsgBox("Mama fume le pipe de papa")
End If

If i = 1 Then
    MsgBox("Papa fume une pipe")
Else
    MsgBox("Mama fume le pipe de papa")
End If

Just go ahead and give it a try.

Bob Beaubien wrote:
If TimeBox.Text = "10:44:01 AM" Then
MsgBox("Timer test", MsgBoxStyle.OkOnly + vbCritical, "Error")
End If

No, no, no, bad, wrong, please don't !!! You are right, this might work, but it is much more likely to not work half the time. If you use your application on a computer that does not have the exact same regional settings, it won't work. If the tick event fires every millisecond or 100th or 10th of a second this code will do what you described: it will fire 999, 99, or 9 times in a row. If you set the interval to 1 second it will more than likely not fire at all, many times. Do yourself a big favor, and delete that code, and forget you ever came up with the idea.

Please stick to the idea I gave you. It will work on any machine, and it will do what it is supposed to do, not just maybe!

In other words, your idea may seem simple, but it is unsafe coding. It is bad, because if you teach yourself to code like that, it will come back and bite you in the ass, many, many, many times in the future.

My advice is free, and you may get what you paid for.

GeneralRe: Timer set time click Pin
TheComputerMan4-Sep-09 9:59
TheComputerMan4-Sep-09 9:59 
GeneralRe: Timer set time click Pin
Bob Beaubien5-Sep-09 2:39
Bob Beaubien5-Sep-09 2:39 
AnswerRe: Timer set time click Pin
Ashfield3-Sep-09 1:34
Ashfield3-Sep-09 1:34 
GeneralRe: Timer set time click Pin
Bob Beaubien3-Sep-09 2:50
Bob Beaubien3-Sep-09 2:50 
GeneralRe: Timer set time click Pin
Ashfield3-Sep-09 3:33
Ashfield3-Sep-09 3:33 
Questioninsert excel worksheet also apply the excel formula in vb.net Pin
newdbo2-Sep-09 21:30
newdbo2-Sep-09 21:30 
AnswerRe: insert excel worksheet also apply the excel formula in vb.net Pin
Bob Beaubien2-Sep-09 21:49
Bob Beaubien2-Sep-09 21:49 
AnswerRe: insert excel worksheet also apply the excel formula in vb.net Pin
TheComputerMan2-Sep-09 22:33
TheComputerMan2-Sep-09 22:33 
GeneralRe: insert excel worksheet also apply the excel formula in vb.net Pin
valkyriexp3-Sep-09 14:04
valkyriexp3-Sep-09 14:04 
QuestionAdding controls to Existing Panel at run time in windows application Pin
kjsl2k92-Sep-09 19:16
kjsl2k92-Sep-09 19:16 
AnswerRe: Adding controls to Existing Panel at run time in windows application Pin
Muhammad Mazhar2-Sep-09 19:48
Muhammad Mazhar2-Sep-09 19:48 
GeneralRe: Adding controls to Existing Panel at run time in windows application Pin
kjsl2k92-Sep-09 19:58
kjsl2k92-Sep-09 19:58 
GeneralRe: Adding controls to Existing Panel at run time in windows application Pin
Dave Kreskowiak3-Sep-09 6:41
mveDave Kreskowiak3-Sep-09 6:41 
QuestionPlease help with Inserting value from DataGrid in Database Table Pin
Hammad Mansoor2-Sep-09 19:00
Hammad Mansoor2-Sep-09 19:00 
AnswerRe: Please help with Inserting value from DataGrid in Database Table Pin
TheComputerMan2-Sep-09 22:22
TheComputerMan2-Sep-09 22:22 
GeneralRe: Please help with Inserting value from DataGrid in Database Table Pin
Hammad Mansoor2-Sep-09 22:38
Hammad Mansoor2-Sep-09 22:38 
GeneralRe: Please help with Inserting value from DataGrid in Database Table Pin
TheComputerMan2-Sep-09 23:08
TheComputerMan2-Sep-09 23:08 

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.