Click here to Skip to main content
15,887,596 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Select all of the text in a textbox Pin
TwoFaced15-May-07 5:55
TwoFaced15-May-07 5:55 
GeneralRe: Select all of the text in a textbox Pin
Dave Kreskowiak15-May-07 6:01
mveDave Kreskowiak15-May-07 6:01 
GeneralRe: Select all of the text in a textbox [modified] Pin
TwoFaced15-May-07 5:53
TwoFaced15-May-07 5:53 
GeneralRe: Select all of the text in a textbox Pin
Dave Kreskowiak15-May-07 6:08
mveDave Kreskowiak15-May-07 6:08 
GeneralRe: Select all of the text in a textbox Pin
TwoFaced15-May-07 6:28
TwoFaced15-May-07 6:28 
GeneralRe: Select all of the text in a textbox Pin
Dave Kreskowiak15-May-07 6:30
mveDave Kreskowiak15-May-07 6:30 
GeneralRe: Select all of the text in a textbox - Windows app Pin
Marcus J. Smith15-May-07 6:15
professionalMarcus J. Smith15-May-07 6:15 
GeneralRe: Select all of the text in a textbox [modified] Pin
Dave Kreskowiak15-May-07 6:20
mveDave Kreskowiak15-May-07 6:20 
TwoFaced wrote:
But the delayed method just seemed cleanest in my opinion and was just as trivial to pull off.


It's just plain bad practice to put a thread to sleep so a UI elemnt can update. I don't believe in putting in Thread Sleeps anywhere for any reason other than to wait a certain amount of time to repeat a task.

Also, your method leave your control open to failure. If the system gets very busy, your thread sleeps then wakes up, but the process you're waiting on hasn't had a chance to execute. Even if it happens just once out of a thousand times, that's one too many, and it'd be a bitch to debug.

Your method doesn't take into account future changes to the base controls either. Mine, on the hand, doesn't care what the base control does. It patiently waits for the base control to do whatever it wants, for however long it wants, then updates to the control to get the functionality we need, only when the MyBase.Onwhatever call returns.

Oh! And there is also a limit to the number of Timers supported per-process and system-wide.




-- modified at 12:27 Tuesday 15th May, 2007

A guide to posting questions on CodeProject[^]

Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic
     2006, 2007


GeneralRe: Select all of the text in a textbox Pin
TwoFaced15-May-07 6:38
TwoFaced15-May-07 6:38 
GeneralRe: Select all of the text in a textbox Pin
Dave Kreskowiak15-May-07 6:55
mveDave Kreskowiak15-May-07 6:55 
AnswerRe: Select all of the text in a textbox [modified] Pin
Xandip15-May-07 19:16
Xandip15-May-07 19:16 
QuestionDelegates are type-safe Function Pointers Pin
Sonia Gupta15-May-07 2:34
Sonia Gupta15-May-07 2:34 
AnswerRe: Delegates are type-safe Function Pointers Pin
Colin Angus Mackay15-May-07 2:37
Colin Angus Mackay15-May-07 2:37 
Questiondelegates Pin
Sonia Gupta15-May-07 2:28
Sonia Gupta15-May-07 2:28 
AnswerRe: delegates Pin
Colin Angus Mackay15-May-07 2:35
Colin Angus Mackay15-May-07 2:35 
QuestionRe: delegates Pin
Sonia Gupta15-May-07 2:48
Sonia Gupta15-May-07 2:48 
AnswerRe: delegates Pin
Guffa15-May-07 3:50
Guffa15-May-07 3:50 
AnswerRe: delegates Pin
Colin Angus Mackay15-May-07 3:51
Colin Angus Mackay15-May-07 3:51 
QuestionRaising and handling events in 2 independant forms. Pin
steve_rm15-May-07 1:51
steve_rm15-May-07 1:51 
AnswerRe: Raising and handling events in 2 independant forms. Pin
Probeer Das15-May-07 3:32
Probeer Das15-May-07 3:32 
AnswerRe: Raising and handling events in 2 independant forms. Pin
Dave Kreskowiak15-May-07 4:06
mveDave Kreskowiak15-May-07 4:06 
Questionhow to resolve it Pin
d_smit15-May-07 1:18
d_smit15-May-07 1:18 
QuestionRe: how to resolve it [modified] Pin
Sonia Gupta15-May-07 1:23
Sonia Gupta15-May-07 1:23 
QuestionRun in Services Pin
Socheat.Net15-May-07 1:14
Socheat.Net15-May-07 1:14 
AnswerRe: Run in Services Pin
harsh_c15-May-07 1:27
professionalharsh_c15-May-07 1:27 

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.