Button Name not changing

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • tshad

    Button Name not changing

    I have an executable that has a button that I want to change the name of to
    "Now Processing...".

    When the process is done, I want to change it back.

    The problem is that the form is not showing the new name. I assume I would
    need to flush it somehow to get the display to show.

    The code is:

    ProcessFiles.Na me = "Now Processing...";

    Transform.Xlate CSVToSQL();

    ProcessFiles.Na me = "Process Files";

    Thanks,

    Tom


  • =?ISO-8859-1?Q?Bj=F8rn_Brox?=

    #2
    Re: Button Name not changing

    tshad skrev:
    I have an executable that has a button that I want to change the name of to
    "Now Processing...".
    >
    When the process is done, I want to change it back.
    >
    The problem is that the form is not showing the new name. I assume I would
    need to flush it somehow to get the display to show.
    >
    The code is:
    >
    ProcessFiles.Na me = "Now Processing...";
    >
    Transform.Xlate CSVToSQL();
    >
    ProcessFiles.Na me = "Process Files";
    >
    It's not the Name you want to change, but the Text


    --
    Bjørn Brox

    Comment

    • tshad

      #3
      Re: Button Name not changing


      "Bjørn Brox" <bpbrox@gmail.c omwrote in message
      news:48766d0e$1 @news.broadpark .no...
      tshad skrev:
      >I have an executable that has a button that I want to change the name of
      >to "Now Processing...".
      >>
      >When the process is done, I want to change it back.
      >>
      >The problem is that the form is not showing the new name. I assume I
      >would need to flush it somehow to get the display to show.
      >>
      >The code is:
      >>
      >ProcessFiles.N ame = "Now Processing...";
      >>
      >Transform.Xlat eCSVToSQL();
      >>
      >ProcessFiles.N ame = "Process Files";
      >>
      It's not the Name you want to change, but the Text
      >
      >
      You're right.

      But when I changed it to the following, it still didn't work.
      ProcessFiles.Te xt = "Now Processing...";

      Transform.Xlate CSVToSQL();

      ProcessFiles.Te xt = "Process Files";

      I know it is changing the text because if I comment the 3rd line where it
      puts the text back - it is now set to "Now Processing..."

      Thanks,

      Tom
      --
      Bjørn Brox

      Comment

      • =?Utf-8?B?Q2lhcmFuIE8nJ0Rvbm5lbGw=?=

        #4
        RE: Button Name not changing

        If the processing is happening on the main thread then the form wont get a
        chance to redraw while the processing is happening. You would need to run the
        processing on another thread which would allow the UI thread to redraw the
        button or try something like this.Refresh or Application.DoE vents
        These are both a little bit hack like to me though. I would put the
        processing on another thread to keep the UI responsive while its happening
        but disable buttons and the like to stop the user doing something the UI is
        not ready for while its happening.


        --
        Ciaran O''Donnell
        try{ Life(); } catch (TooDifficultException) { throw Toys(); }



        "tshad" wrote:
        I have an executable that has a button that I want to change the name of to
        "Now Processing...".
        >
        When the process is done, I want to change it back.
        >
        The problem is that the form is not showing the new name. I assume I would
        need to flush it somehow to get the display to show.
        >
        The code is:
        >
        ProcessFiles.Na me = "Now Processing...";
        >
        Transform.Xlate CSVToSQL();
        >
        ProcessFiles.Na me = "Process Files";
        >
        Thanks,
        >
        Tom
        >
        >
        >

        Comment

        • Peter Duniho

          #5
          Re: Button Name not changing

          On Thu, 10 Jul 2008 15:03:40 -0700, tshad <tshad@dslextre me.comwrote:
          [...]
          But when I changed it to the following, it still didn't work.
          ProcessFiles.Te xt = "Now Processing...";
          >
          Transform.Xlate CSVToSQL();
          >
          ProcessFiles.Te xt = "Process Files";
          As mentioned by Ciaran, you can't run your processing in the GUI thread
          and expect the change to the text of the button to be visually updated.
          You're blocking the GUI thread, which prevents the button from redrawing
          itself when the text changes.

          Put your processing in a different thread.

          Pete

          Comment

          Working...