PC Review


Reply
Thread Tools Rate Thread

Button Name not changing

 
 
tshad
Guest
Posts: n/a
 
      10th Jul 2008
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.Name = "Now Processing...";

Transform.XlateCSVToSQL();

ProcessFiles.Name = "Process Files";

Thanks,

Tom


 
Reply With Quote
 
 
 
 
Bjørn Brox
Guest
Posts: n/a
 
      10th Jul 2008
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.Name = "Now Processing...";
>
> Transform.XlateCSVToSQL();
>
> ProcessFiles.Name = "Process Files";
>

It's not the Name you want to change, but the Text


--
Bjørn Brox
 
Reply With Quote
 
tshad
Guest
Posts: n/a
 
      10th Jul 2008

"Bjørn Brox" <(E-Mail Removed)> wrote in message
news:48766d0e$(E-Mail Removed)...
> 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.Name = "Now Processing...";
>>
>> Transform.XlateCSVToSQL();
>>
>> ProcessFiles.Name = "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.Text = "Now Processing...";

Transform.XlateCSVToSQL();

ProcessFiles.Text = "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



 
Reply With Quote
 
Ciaran O''Donnell
Guest
Posts: n/a
 
      11th Jul 2008
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.DoEvents
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
http://wannabedeveloper.spaces.live.com


"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.Name = "Now Processing...";
>
> Transform.XlateCSVToSQL();
>
> ProcessFiles.Name = "Process Files";
>
> Thanks,
>
> Tom
>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
WPF - Changing Radio Button to have Command Button Style??? samadams_2006@yahoo.ca Microsoft C# .NET 1 7th Feb 2009 04:17 PM
Ajax, changing text in a button, and button click problem Tim Microsoft ASP .NET 0 23rd Jul 2008 08:57 PM
changing toggle button via VBA thread Microsoft Access 0 10th May 2007 03:31 PM
How to simulate the visual effect of "button pressed" by changing 3d button element's up-left and down-right border color? b6s Microsoft Dot NET Framework Forms 0 1st Dec 2006 06:38 AM
changing the start button sherry Windows XP Customization 0 20th Dec 2003 12:19 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:44 PM.