Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / March 2008

Tip: Looking for answers? Try searching our database.

Best way to display real-time data in place?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
phileo - 18 Mar 2008 23:16 GMT
I have an application where I wish to display and update some text in
place, eg:

Status1 = val123
Status2 = val345
Status3 = val456

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?
Peter Duniho - 18 Mar 2008 23:30 GMT
> [...]
> 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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.