Click here to Skip to main content
15,908,901 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Issue when create popup calendar.... Pin
Golden Jing14-Dec-09 20:07
Golden Jing14-Dec-09 20:07 
GeneralRe: Issue when create popup calendar.... Pin
EliottA15-Dec-09 3:25
EliottA15-Dec-09 3:25 
QuestionVB Form Commands in TextBoxes Pin
Dimz9313-Dec-09 4:10
Dimz9313-Dec-09 4:10 
AnswerRe: VB Form Commands in TextBoxes Pin
EliottA13-Dec-09 17:25
EliottA13-Dec-09 17:25 
AnswerRe: VB Form Commands in TextBoxes Pin
Eddy Vluggen14-Dec-09 0:59
professionalEddy Vluggen14-Dec-09 0:59 
QuestionNo Connection? Pin
teknozwizard12-Dec-09 21:25
teknozwizard12-Dec-09 21:25 
QuestionHelp with VB 2008.NET, Please [modified] PinPopular
treashunter10-Dec-09 20:21
treashunter10-Dec-09 20:21 
AnswerRe: Help with VB 2008.NET, Please Pin
Johan Hakkesteegt10-Dec-09 22:27
Johan Hakkesteegt10-Dec-09 22:27 
The MyBase.Paint event happens a lot, that's why your dialog gets openend constantly.

Setting aside the question of how wise it is to try and do this kind of operation in that particular event, you are checking to see if the boolean button2 is false, which would be the correct way to prevent this code from being executed all the time. However, because you dim the boolean inside the same event with an explicit value of False, it will never ever be true.
If this really does what you say it does, than the code you posted is not the code that you are running, or you just didn't post the entire code here. If the boolean somehow gets set to True between its creation and checking it's value, the Paint event may fire again before the boolean gets set to false (which, according to this code, only happens at the moment you create the boolean). Which is the main reason not to use this event for what you are doing here.

So the questions are:
- did you create a boolean with the exact same name outside this event, particularly at the class level (outside any sub or function) ?
- Is there any code anywhere in your application that should set that boolean to True?

Tips:
- Use the Try catch clase and run your app in visual studio, and step through it line by line (put a break point at the first line, and press F11 to advance one statement).
- Try to run your code inside a controlled event, like the button click event, first, before using it in volatile events like Paint.

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

GeneralRe: Help with VB 2008.NET, Please Pin
treashunter10-Dec-09 22:36
treashunter10-Dec-09 22:36 
GeneralRe: Help with VB 2008.NET, Please Pin
Tom Deketelaere10-Dec-09 23:42
professionalTom Deketelaere10-Dec-09 23:42 
GeneralRe: Help with VB 2008.NET, Please Pin
treashunter10-Dec-09 23:49
treashunter10-Dec-09 23:49 
GeneralRe: Help with VB 2008.NET, Please Pin
Tom Deketelaere10-Dec-09 23:57
professionalTom Deketelaere10-Dec-09 23:57 
GeneralRe: Help with VB 2008.NET, Please PinPopular
treashunter11-Dec-09 0:06
treashunter11-Dec-09 0:06 
GeneralRe: Help with VB 2008.NET, Please Pin
dan!sh 11-Dec-09 0:11
professional dan!sh 11-Dec-09 0:11 
GeneralRe: Help with VB 2008.NET, Please Pin
The Man from U.N.C.L.E.11-Dec-09 23:06
The Man from U.N.C.L.E.11-Dec-09 23:06 
GeneralRe: Help with VB 2008.NET, Please Pin
Paul Conrad12-Dec-09 4:56
professionalPaul Conrad12-Dec-09 4:56 
GeneralRe: Help with VB 2008.NET, Please Pin
Johan Hakkesteegt11-Dec-09 2:37
Johan Hakkesteegt11-Dec-09 2:37 
AnswerRe: Help with VB 2008.NET, Please Pin
Paul Conrad12-Dec-09 4:59
professionalPaul Conrad12-Dec-09 4:59 
QuestionHow to check Internet connection Pin
Tufail Ahmad10-Dec-09 18:28
Tufail Ahmad10-Dec-09 18:28 
AnswerRe: How to check Internet connection Pin
Eddy Vluggen11-Dec-09 2:13
professionalEddy Vluggen11-Dec-09 2:13 
GeneralRe: How to check Internet connection Pin
Tufail Ahmad11-Dec-09 19:00
Tufail Ahmad11-Dec-09 19:00 
GeneralRe: How to check Internet connection Pin
The Man from U.N.C.L.E.11-Dec-09 23:09
The Man from U.N.C.L.E.11-Dec-09 23:09 
AnswerRe: How to check Internet connection Pin
εїзεїзεїз12-Dec-09 0:32
εїзεїзεїз12-Dec-09 0:32 
AnswerRe: How to check Internet connection Pin
Paul Conrad12-Dec-09 5:00
professionalPaul Conrad12-Dec-09 5:00 
QuestionWorking with numbers???? Pin
A-dogg200910-Dec-09 17:49
A-dogg200910-Dec-09 17:49 

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.