displaying data realtime in a textbox

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?YXVsZGg=?=

    displaying data realtime in a textbox

    hello,
    i'm not sure if this is possible. i have a small VS 2005 C# windows
    application. it has a textbox and a button. once the user presses the button
    it fires off many tasks. i want to use the "textbox" to give realtime update,
    a status window.

    it seems that in some part of the program the window form goes blank and
    there is no status. however once the program stops i get my textbox/status
    updates.

    so the question is, can i get the textbox to give realtime update? i tried
    the textbox.refresh () and nothing. i get no status/updates until the program
    stops running.
  • Paul E Collins

    #2
    Re: displaying data realtime in a textbox

    "auldh" <auldh@discussi ons.microsoft.c omwrote:
    i want to use the "textbox" to give realtime update
    [...]
    it seems that in some part of the program the window form goes blank
    and there is no status.
    If you do long-running tasks on the main (GUI) thread, the window can't
    update properly. Use the BackgroundWorke r control, or create a separate
    thread to do the long-running task.

    Eq.


    Comment

    • =?Utf-8?B?YXVsZGg=?=

      #3
      Re: displaying data realtime in a textbox

      thanks Paul, i will research this.

      "Paul E Collins" wrote:
      "auldh" <auldh@discussi ons.microsoft.c omwrote:
      >
      i want to use the "textbox" to give realtime update
      [...]
      it seems that in some part of the program the window form goes blank
      and there is no status.
      >
      If you do long-running tasks on the main (GUI) thread, the window can't
      update properly. Use the BackgroundWorke r control, or create a separate
      thread to do the long-running task.
      >
      Eq.
      >
      >
      >

      Comment

      • JamesB

        #4
        Re: displaying data realtime in a textbox


        "Paul E Collins" <find_my_real_a ddress@CL4.orgw rote in message
        news:Gp-dnZG6R9ohp0XanZ 2dnUVZ8j6dnZ2d@ bt.com...
        "auldh" <auldh@discussi ons.microsoft.c omwrote:
        >
        >i want to use the "textbox" to give realtime update
        >[...]
        >it seems that in some part of the program the window form goes blank and
        >there is no status.
        >
        If you do long-running tasks on the main (GUI) thread, the window can't
        update properly. Use the BackgroundWorke r control, or create a separate
        thread to do the long-running task.
        >
        Auldh has the better answer, but for something quick and dirty, you might
        want to put some "Application.Do Events()" in at various points (i.e. where
        you put in the Refresh()) - this will enable the UI to update.

        Comment

        • Peter Duniho

          #5
          Re: displaying data realtime in a textbox

          On Thu, 13 Mar 2008 01:23:33 -0700, JamesB
          <jamesb@somewhe re.com.net.com. netwrote:
          Auldh has the better answer, but for something quick and dirty, you
          might want to put some "Application.Do Events()" in at various points
          (i.e. where you put in the Refresh()) - this will enable the UI to
          update.
          Please do not recommend Application.DoE vents() when there are other,
          superior alternatives available. It's not something to be used in a
          well-written program and is not appropriate as a recommendation.

          If you observe a situation where the _only_ way to solve the problem is
          calling DoEvents(), by all means suggest it. Otherwise, you're only
          encouraging sloppy programming practices and that's not something that any
          responsible person should want to do.

          Pete

          Comment

          Working...