Click here to Skip to main content
15,893,588 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Streamwriter and thread safety Pin
NeilPrice6-Feb-09 10:35
NeilPrice6-Feb-09 10:35 
GeneralRe: Streamwriter and thread safety Pin
Dave Kreskowiak6-Feb-09 11:12
mveDave Kreskowiak6-Feb-09 11:12 
GeneralRe: Streamwriter and thread safety Pin
NeilPrice6-Feb-09 11:28
NeilPrice6-Feb-09 11:28 
GeneralRe: Streamwriter and thread safety Pin
Luc Pattyn6-Feb-09 11:41
sitebuilderLuc Pattyn6-Feb-09 11:41 
QuestionTextbox prblem Pin
-kikica0512-6-Feb-09 9:09
-kikica0512-6-Feb-09 9:09 
GeneralRe: Textbox prblem Pin
Luc Pattyn6-Feb-09 9:26
sitebuilderLuc Pattyn6-Feb-09 9:26 
GeneralRe: Textbox prblem Pin
-kikica0512-6-Feb-09 19:29
-kikica0512-6-Feb-09 19:29 
GeneralRe: Textbox prblemsta Pin
Luc Pattyn7-Feb-09 3:16
sitebuilderLuc Pattyn7-Feb-09 3:16 
OK,

these are the two most popular mistakes that would lead to the updated text not showing
or not showing right away:

1.
say your form class is called myForm, you have more than one myForm instance; the first one
got created and is visible on the screen, the second or later one(s) is/are created inside
the button click handler, listbox double click handler, or where ever, and that is the one
you are modifying, but since you never Show or ShowDialog it, it does
not show at all, hence you don't see the changes.
If this is the case, the right thing to do is NOT to create more than one myForm instance, and to make sure it is the first and only instance that gets modified. If more than one form class is involved, you need to either pass one form to the other (a bad idea), pass one control to the other form (a bad idea), install a public method to update a form's Control from the outside (acceptable) or a delegate and an event (best practice). There are several articles on this subject here at CP.

2.
you are performing a lengthy operation on the GUI thread, say you modify the textbox text,
then count the number of files on your disk, then exit the lisybox double click handler; as
long as the handler is busy, whatever changes it applied to the GUI Controls will not show;
the GUI will update when the handler exits though.
If this is the case, the right thing to do is NOT to perform lengthy operations on the GUI thread;
for good GUI behavior handler execution should never last longer than say 30 msec. If it
takes more, or could take more, the job must be delegated to a separate thread (a real thread,
one from the ThreadPool, a BackgroundWorker, whatever); be careful then to not let it touch
GUI Controls directly, you would need Control.InvokeRequired/Control.Invoke for that. If you need this, look it up in MSDN and read some CP articles on the subject.

Hope this helps.

PS: next time you show some code, please use the "code block" button below the edit window,
it will insert PRE tags which give a monospaced font, a background color and foremost they
preserve all formatting.

Luc Pattyn [Forum Guidelines] [My Articles]

- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets


AnswerRe: Textbox prblem [modified] Pin
Samir Ibrahim7-Feb-09 7:28
Samir Ibrahim7-Feb-09 7:28 
Question[Message Deleted] Pin
spruha3696-Feb-09 3:08
spruha3696-Feb-09 3:08 
AnswerRe: searching all types of files in all drives Pin
Dave Kreskowiak6-Feb-09 3:45
mveDave Kreskowiak6-Feb-09 3:45 
AnswerRe: searching all types of files in all drives Pin
Christian Graus6-Feb-09 10:25
protectorChristian Graus6-Feb-09 10:25 
General[Message Deleted] Pin
spruha3696-Feb-09 15:06
spruha3696-Feb-09 15:06 
GeneralRe: searching all types of files in all drives Pin
Dave Kreskowiak6-Feb-09 18:59
mveDave Kreskowiak6-Feb-09 18:59 
GeneralRe: searching all types of files in all drives Pin
Samir Ibrahim7-Feb-09 6:50
Samir Ibrahim7-Feb-09 6:50 
GeneralRe: searching all types of files in all drives Pin
Dave Kreskowiak7-Feb-09 9:02
mveDave Kreskowiak7-Feb-09 9:02 
General[Message Deleted] Pin
spruha3698-Feb-09 19:00
spruha3698-Feb-09 19:00 
GeneralRe: searching all types of files in all drives Pin
Mycroft Holmes8-Feb-09 21:31
professionalMycroft Holmes8-Feb-09 21:31 
GeneralRe: searching all types of files in all drives Pin
Dave Kreskowiak9-Feb-09 1:48
mveDave Kreskowiak9-Feb-09 1:48 
Questioncode to import calendars from application such as outlook,hotmail, Gmail Pin
naria20066-Feb-09 2:58
naria20066-Feb-09 2:58 
AnswerRe: code to import calendars from application such as outlook,hotmail, Gmail Pin
Steven J Jowett6-Feb-09 3:00
Steven J Jowett6-Feb-09 3:00 
GeneralRe: code to import calendars from application such as outlook,hotmail, Gmail Pin
naria20066-Feb-09 3:15
naria20066-Feb-09 3:15 
QuestionBasic looping problem Pin
kanchoette6-Feb-09 2:32
kanchoette6-Feb-09 2:32 
AnswerRe: Basic looping problem Pin
Henry Minute6-Feb-09 2:37
Henry Minute6-Feb-09 2:37 
GeneralRe: Basic looping problem Pin
kanchoette6-Feb-09 2:43
kanchoette6-Feb-09 2:43 

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.