Click here to Skip to main content
15,890,882 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: DataGridView populates only first row Pin
Eddy Vluggen29-Dec-13 17:12
professionalEddy Vluggen29-Dec-13 17:12 
QuestionLINQ Pin
tsunamigang23-Dec-13 18:04
tsunamigang23-Dec-13 18:04 
AnswerRe: LINQ Pin
thatraja23-Dec-13 20:09
professionalthatraja23-Dec-13 20:09 
GeneralRe: LINQ Pin
tsunamigang23-Dec-13 22:08
tsunamigang23-Dec-13 22:08 
QuestionProgressbar value not accurate? Pin
Sonhospa21-Dec-13 0:50
Sonhospa21-Dec-13 0:50 
AnswerRe: Progressbar value not accurate? Pin
Dave Kreskowiak21-Dec-13 4:50
mveDave Kreskowiak21-Dec-13 4:50 
NewsRe: Progressbar value not accurate? Pin
Sonhospa21-Dec-13 9:04
Sonhospa21-Dec-13 9:04 
GeneralRe: Progressbar value not accurate? Pin
Dave Kreskowiak21-Dec-13 11:34
mveDave Kreskowiak21-Dec-13 11:34 
It doesn't work because you're hogging the UI thread with this code. The Thread.Sleep doesn't help.

What I mean by "hogging" is that you're not letting the UI thread process any messages from Windows, like WM_PAINT, that tells individual controls to update themselves. For a "quick fix" you can replace the line that says myLabel.Update() with Application.DoEvents(). This will process all pending messages in the application message pump, including drawing messages.

This is NOT the correct way to do this! This is a hack to get your example code working! The correct way to do this would be to move the long running code (you simulated this with the Thread.Sleep call) to a background thread and Invoke calls to update the UI controls on the UI thread.

QuestionVerification Failure (DigitalPersona 4000B) Pin
Member 1048039921-Dec-13 0:35
Member 1048039921-Dec-13 0:35 
AnswerRe: Verification Failure (DigitalPersona 4000B) Pin
Dave Kreskowiak21-Dec-13 4:46
mveDave Kreskowiak21-Dec-13 4:46 
QuestionException Pin
tsunamigang19-Dec-13 20:10
tsunamigang19-Dec-13 20:10 
AnswerRe: Exception Pin
Richard MacCutchan19-Dec-13 21:57
mveRichard MacCutchan19-Dec-13 21:57 
QuestionAnyone else with VB 2010 forms suddenly slow? Pin
BradITM19-Dec-13 11:43
BradITM19-Dec-13 11:43 
AnswerRe: Anyone else with VB 2010 forms suddenly slow? Pin
Dave Kreskowiak19-Dec-13 12:46
mveDave Kreskowiak19-Dec-13 12:46 
AnswerRe: Anyone else with VB 2010 forms suddenly slow? Pin
Simon_Whale20-Dec-13 5:05
Simon_Whale20-Dec-13 5:05 
QuestionDelegate Pin
tsunamigang18-Dec-13 19:35
tsunamigang18-Dec-13 19:35 
AnswerRe: Delegate Pin
Richard MacCutchan18-Dec-13 21:59
mveRichard MacCutchan18-Dec-13 21:59 
QuestionVB Tutorial Pin
tgsb17-Dec-13 19:57
tgsb17-Dec-13 19:57 
AnswerRe: VB Tutorial Pin
Chris Quinn17-Dec-13 21:12
Chris Quinn17-Dec-13 21:12 
AnswerRe: VB Tutorial Pin
Simon_Whale17-Dec-13 22:00
Simon_Whale17-Dec-13 22:00 
AnswerRe: VB Tutorial Pin
thatraja17-Dec-13 23:44
professionalthatraja17-Dec-13 23:44 
Questionbarcode generator Pin
Member 1047210217-Dec-13 3:00
Member 1047210217-Dec-13 3:00 
AnswerRe: barcode generator Pin
David Mujica17-Dec-13 3:34
David Mujica17-Dec-13 3:34 
QuestionBest way to save data in Visual basic Pin
HimanshuSha17-Dec-13 1:45
HimanshuSha17-Dec-13 1:45 
AnswerRe: Best way to save data in Visual basic Pin
Tim Carmichael17-Dec-13 2:13
Tim Carmichael17-Dec-13 2:13 

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.