> [...]
> The valXXX is real-time data which needs to be periodically updated
> and re-displayed at the same location in the console (effectively
> overwriting the old valXXX numbers).
>
> Is a TextBox the best way to do this, or is there a better approach?
Impossible to say whether TextBox is the "best way", without more
specifics.
Basically, if you have a Forms application in which you want to display
some information, and that information can be formatted as text, and doing
so it the most natural way to present that information to the user, then
sure...one of the text-based Forms controls would be appropriate.
For straight-forward display, I prefer the Label control. But if you want
the user to be able to select the text (for example, so that they can copy
and paste it elsewhere), a TextBox would be required. You can make the
TextBox read-only so that the user can only select the text, without
changing it. If you have a need to include formatting in the display,
then you'll need to use RichTextBox.
Of course, you can always implement your own custom control to display the
data in whatever way you like. So if you have needs beyond what these
controls provide, that's always an option.
Pete
Devin - 19 Mar 2008 01:47 GMT
On Mar 18, 6:30 pm, "Peter Duniho" <NpOeStPe...@nnowslpianmk.com>
wrote:
> > [...]
> > The valXXX is real-time data which needs to be periodically updated
[quoted text clipped - 23 lines]
>
> Pete
As another suggestion, if the real-time data is derived from some kind
of continous running process, you might want to update asynchronously
by means of a separate thread or maybe a BackgroundWorker. This will
allow continuous user interface with the form and prevent undesired
effects such as the form not re-painting itself.
Devin
Devin - 19 Mar 2008 01:49 GMT
On Mar 18, 6:30 pm, "Peter Duniho" <NpOeStPe...@nnowslpianmk.com>
wrote:
> > [...]
> > The valXXX is real-time data which needs to be periodically updated
[quoted text clipped - 23 lines]
>
> Pete
As another suggestion, if the real-time data is derived from some kind
of continous running process, you might want to update asynchronously
by means of a separate thread or maybe a BackgroundWorker. This will
allow continuous user interface with the form and prevent undesired
effects such as the form not re-painting itself.
Devin