|
A rich text box, but you could also give me the code for a plain text box.
Dave Kreskowiak wrote: You're appending text to the bottom of a textbox
Yes I'm also doing that, if it detects a new message, which there always is
|
|
|
|
|
RichTextBox.ScrollToCaret[^]
The trick with the is the caret must be at the end of the text in order for this to work. That's easy enough with RTB.SelectionStart = RTG.Text.Length .
The same code works for a TextBox.
|
|
|
|
|
How to check the double vaue is "1.#QNAN" in VB 6?
modified 7-Mar-12 5:16am.
|
|
|
|
|
Have a read of this Double.IsNaN[^]
Lobster Thermidor aux crevettes with a Mornay sauce, served in a Provençale manner with shallots and aubergines, garnished with truffle pate, brandy and a fried egg on top and Spam - Monty Python Spam Sketch
|
|
|
|
|
This method is avaialble inVB.NET.But I wnat to use in vb6.Kindly support me for vb6 programme
|
|
|
|
|
Private Sub btnStart_Click(sender As System.Object, e As System.EventArgs) Handles btnStart.Click
lblTextHere.Text = "READY"
System.Threading.Thread.Sleep(2000)
lblTextHere.Text = "SET"
System.Threading.Thread.Sleep(2000)
lblTextHere.Text = "FIRST PLAYER'S TURN"
Timer1.Start()
End Sub
sometimes i wonder why this thing can't work.
it works just the last text.
|
|
|
|
|
No, not a threading problem. The problem is all of this code runs on the UI thread. The UI thread also handles the apps message pump, where Windows send messsages to your application, like Paint messages.
So, you set the label text to "READY", then you put the UI thread to sleep, so it can't possibly get and handle the Paint message (your code gets this as a Paint event) and your label never gets painted. The thread wakes up and the next line of code sets the label text to "SET" and then goes to sleep again. You get the idea.
Meanwhile, all these paint messages are piling up in the message queue, waiting for your UI thread to get around to picking them up, which it won't do until your Click handler code finishes and returns. Once that happens, the UI thread gets to the messages and process them all. All the Paint messages are processed and you see the final result, the label text changing to "FIRST PLAYER'S TURN".
Oddly enough, the solution is a threading problem.
In order to keep the UI thread from stalling, you have to move your Sleeps to another thread and ship the setting of the Label Text property back to the UI thread, called Invoke. You can read up more on the technique
here[^].
modified 5-Mar-12 22:11pm.
|
|
|
|
|
Your code won't do what you want for the reason Dave explained.
As the delays are there to get some pause in between changes to the user interface, the better approach is to use a "state machine" and a timer, and more particularly a System.Windows.Forms.Timer which will fire its Tick event periodically; the state machine evolves form state 0, to state 1, then state 2, etc until it is done, so you'll need at least one state variable to know how far your state machine has progressed. This may be simpler than adding another thread, as extra threads are easy for scheduling stuff, but not so for accessing Controls.
|
|
|
|
|
Wow. The Vicodin I'm on is really messing with me! This never crossed my mind.
|
|
|
|
|
There is always a dilemma between coding some asynchronous operations, and adding an extra thread. Asynchronous may be cheaper (no stack, it gets borrowed from the threadpool), an explicit thread may be simpler to code (no explicit state machine required, the program counter works like a state variable). Therefore, whenever you think of the one solution, you should also consider the alternative; however for GUI stuff, the timer most often will win.
BTW: you shouldn't be taking drugs while coding, it may be dangerous to the health of your code.
|
|
|
|
|
Luc,
we might just let this one slip... After all, Dave did say he was coding in VI
|
|
|
|
|
HEY! VI looks like Word when comered to EDLIN! Now that's a REAL mans IDE!
|
|
|
|
|
Luc Pattyn wrote: BTW: you shouldn't be taking drugs while coding, it may be dangerous to the
health of your code.
Well, there's the beuty of it! Because around here, it's not MY code that's in danger!
|
|
|
|
|
Hi All,
how to hide assemblies default icon after running any exe in vb.net(Windows app)?
in vb.net running any exe then its icon will be show in the taskbar.how to hide running exe icon using vb.net?
help me!
Thanks,
|
|
|
|
|
jayawant sawant wrote: how to hide assemblies default icon after running any exe in vb.net(Windows
app)?
Simple; you don't - it's the users' computer, and the user is in control.
Why are you trying to achieve this?
If you just want to hide the icon, try using one that's completely transparent.
Bastard Programmer from Hell
modified 5-Mar-12 16:56pm.
|
|
|
|
|
This is the second time that you have asked a variant on this question in less than 5 hours.
Hiding applications is bad practice and will make other CP users think you are trying to develop something mischievous.
I would suggest that you try to give us some more information on what you are trying to achieve / develop, so that you can be advised better.
Lobster Thermidor aux crevettes with a Mornay sauce, served in a Provençale manner with shallots and aubergines, garnished with truffle pate, brandy and a fried egg on top and Spam - Monty Python Spam Sketch
|
|
|
|
|
Who says hiding applications is bad practice?
I cannot see how you would get the impression that the posted question is somehow mischievous.
Moreover, what do you care how many times they posted this question. Maybe the poster is trying different questions in order to solicit different suggestions, or asking the question differently do to language limitations.
|
|
|
|
|
Andy Missico wrote: Who says hiding applications is bad practice?
Just about everybody. The only reason to hide an application is to prevent the user/owner of the PC from knowing what is going on; chances are this is for illegal purposes.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
There are lots of reasons to hide the application; logon utility for enterprise-wide systems, input applications such as system-wide shortcut keys, search indexer, connection manager, image cache manager, continous on-line backup, and on and on and on.
Just open task-manager and look at all those many processes and those few applications.
There is a difference between hiding the application and making an application undetectable.
|
|
|
|
|
You can't. Since it's a seperate process, it has full control over its own icon on the taskbar.
|
|
|
|
|
|
Hi all,
how to hide exe into taskmanager in windows 7 using vb.net windows application?
I want exe is hide into task-manager in windows 7 & windows vista machine using vb.net(windows application)
help me!
Thanks,
Jayawant
|
|
|
|
|
Why would you want to do that?
Lobster Thermidor aux crevettes with a Mornay sauce, served in a Provençale manner with shallots and aubergines, garnished with truffle pate, brandy and a fried egg on top and Spam - Monty Python Spam Sketch
|
|
|
|
|
Lots of reasons; logon utility for enterprise-wide systems, input applications such as system-wide shortcut keys, search indexer, connection manager, image cache manager, continous on-line backup, and on and on and on.
Just open task-manager and look at all those many processes and those few applications.
|
|
|
|
|
You can't. It's not possible to hide an .EXE from Task Manager and there is never a good reason to do so.
|
|
|
|