textbox acting weirdly, dont understand why

theonebit

Member
Joined
Sep 25, 2011
Messages
10
Programming Experience
1-3
I have a code that create a connection to a server and download data stream.

ok. now i put a textbox to monitor each parameter so i can see the result at stages.

now in console each stage is shown clearly and there is no hang.

but it seem when i use a multiline text box, it wait for everything to complete then show the stage result.

why is that so...
i am confuse, I ran a timer test to add a line every 2 sec and it went accordingly.
my software on the other hand....

anyone here knows why???
 
From the information provided, the most likely explanation is that you are doing everything on the UI thread and, because it is so busy retrieving the data from the server, it has no time to actually display the data in the TextBox. You might try calling the Refresh method of your TextBox after setting its Text property and, if the text appears, that is almost certainly the issue. That's not really a solution though. A proper solution would involve not retrieving the data on the UI thread in the first place.
 
no no.... the timer test was to check the textbox whether it could do console replication.
anyhow, i get the ui thread stuff. a solution is background worker if i am not mistaken.

but apart from that how do i actually use the textbox dynamically. I mean i refresh like the console.

I tried with the loop fuction to test and the result is the same textbox display only after the work is done unlike console which shows you progress.

any ideas...
 
ok. no worries bro.. pls dont trouble yourself.....

by the way i did not ignore, you said try the refresh to confirm, but it no point since the thing waits for whatever i am doing to complete then shows its text. which i explain (which is why i am asking) and i also mention the other method you mention (if i ignored, i wont mention it) . at least i tried to explain what i have been to doing. not asking for ideas just like that or asking for somebody to come up with a solution.

so again thank you for the trouble you have taken but pls dont trouble yourself anymore and sorry if you feel that i ignored you which i sincerely did not.
 
If there was no point then I wouldn't have suggested it. You're posting here because you want people with more experience than you have to use that experience to help you. If I had less than 10 posts and some with 10,000 posts suggested that I try something, I'd probably try it. If I couldn't see the point of it then I'd put that down to my own inexperience and guess that they probably knew something that I didn't.
 
I surely hope i dont get banned for this. but OMG!!!
are you serious that you are playing i have 10000 over post card.... oh boy....

anyhow since i did not say i did not try but i say its no point because its the same thing...
for god sake did you ignore to read my first post....
i said console it when fine no worries anywhere
textbox somehow it wants to wait for everything to finish then shows the text

you suggest use the .refresh to force the control to redraw
i said no point because even though it forces the textbox to redraw it still hangs at the point where it doing work (eg trying to connect to server, whereby the console does not do this, and does not need background worker either)
and with that suggestion also i have to add refresh line at the bottom of every .text line

what i dont understand is that since vb does it work line by line why should i refresh all the time just to emulate a console.
and what i am looking for is an explaination rather than code as i do not remember asking for code, i ask why and any ideas

you explain it was busy and i should not do it in ui, it still doesnt make sense since

textbox1.text = "connecting to server"
connecttoserver = parameter

i pass the text first then the connection not the connection first then the text. same thing i have about 15 lines above telling something according to the work. why all text doesnt show until it finish doing all the work. i sure it got plenty of time to update before getting to the connection to server part.

I hope you dont get this wrong, but IMHO 10,000 post doest not count as experience and by just trying to show you have that many is also a sign of proudness and also brings the inevitable arrogance. If all your 10000 post were problem solving code, man... i will not even dare to utter a word but otherwise if it were suggestion and point of view or opinions or maybe simple chat, how that count as experience beats me. By just saying that i have less than 10 post you have already judge me as a newbie and a person that does not listen or simply an imbecil. So if i have 10000 post just as you and if i ask the same question and i state the same answer, does it still count as ignore or you would think otherwise. Maybe your answer will be that if i have 10000 post count i will not be asking such a question... I dont know...


Anyhow i post here for a discussion, if you feel that post count is the main concern where a discusion can be hold than i feel sorry for you. You assume i ignored you then you assume i did not try and maybe next i will get banned. but at least in all my post i mention that i was doing something and also explaining along with it. if you had a point and since you could clearly see i did not catch it, since in your eyes or post count i was less experience, instead of pointing it out, you just said i ignored you... if you also had many many experience why did not understand when i said there was no point.... I did not judge you, all i saw was a friend trying to help.
 
I'm not going to waste my time reading your post. There was a point to my suggestion and that point was to determine whether what I suspected was the issue was actually the issue. If you had just done it in the first place then I would have known and, if I was right, I could have helped with a solution. You decided you knew better though. Good luck with that.
 
Back
Top