473,396 Members | 2,020 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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.Name = "Now Processing...";

Transform.XlateCSVToSQL();

ProcessFiles.Name = "Process Files";

Thanks,

Tom
Jul 10 '08 #1
4 1684
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
Jul 10 '08 #2

"Bjørn Brox" <bp****@gmail.comwrote in message
news:48********@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.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

Jul 10 '08 #3
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
Jul 11 '08 #4
On Thu, 10 Jul 2008 15:03:40 -0700, tshad <ts***@dslextreme.comwrote:
[...]
But when I changed it to the following, it still didn't work.
ProcessFiles.Text = "Now Processing...";

Transform.XlateCSVToSQL();

ProcessFiles.Text = "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
Jul 11 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Matt | last post by:
I have radio buttons on a form, and when the user makes the selection, it will trigger the event and send the form to the web server and print the selected value. In Case 1, I just use submit...
6
by: Fred Phase | last post by:
The following button definition works fine in Mozilla where the value "in" is assigned to "awol_status". In Internet Explorer 6.0.2800.1106 on Win 2K the value "switch status" is assigned to...
5
by: AFN | last post by:
I'm trying to set a submit button to change text and color when clicked. Like saying "please wait" instead of "submit" and then changing the background color and text color. All works, except for...
1
by: MickG | last post by:
I am trying to change the value of the variable "hard" according to which radio button is pressed and I am having no joy. Could anyone help me with this, the problematic section is marked with...
2
by: chris | last post by:
i have a form with 3 buttons with a text box next to each button what i want to do is when a textbox is filled out the default button is changed to the button next to that text box rather than...
9
by: Ant | last post by:
Hi, I'm wondering if anybody can tell me what the Validate document button is used for & how to use it. When I deliberately put some tag in that shouldn't be there, (such as an extra body tag) &...
6
by: sgottenyc | last post by:
Hello, If you could assist me with the following situation, I would be very grateful. I have a table of data retrieved from database displayed on screen. To each row of data, I have added...
1
by: rag84dec | last post by:
Hi, I have an asp code which creates a grid or matrics (5 x 5 matrics).Each cell contains a button which will have an initial .The initial will be read from a database. say the database has...
8
by: mike_solomon | last post by:
I have a button <input type="submit" name="Delete" value="Delete"> This code can not be changed I want to use Javascript to change the type I tried:
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.