Button.Text property not updated in compiled executable
Hello folks,
Sometimes (including right now) when i change a property in my program, such as the text property
of buttons and labels, and i run the debug button in visual studio 2010 (.net 4.0), the text remains
unchanged.
button1.Text has been: "Test Credentials" for forever.
Now i want to change this property to "Test FTP Credentials".
In visual studio, everything looks and acts normal, but when i hit the debug button, the text is still: "Text Credentials"
I experienced this problem on other computers and visual studio versions as well, and am not
entirely sure of the cause, but i think maybe the executable or some parts of it, are cached somewhere, and not updated, but that is just a guess.
Does this sound familiar to anyone?
Re: Button.Text property not updated in compiled executable
Where are you changing the text property? The properties dialog? The source code?
Also, you can do a rebuild all solution to get rid of any cached files.
Re: Button.Text property not updated in compiled executable
Quote:
Originally Posted by
Arjay
Where are you changing the text property? The properties dialog? The source code?
Also, you can do a rebuild all solution to get rid of any cached files.
I am changing the text property in the properties dialog.
Can you tell me where i can find the "rebuild" option in VS2010 ?
I only have the "build" option in the debug submenu.
Google search did not give me much to go on.
1 Attachment(s)
Re: Button.Text property not updated in compiled executable
Look under the 'build' menu for 'Rebuild Solution'.
Re: Button.Text property not updated in compiled executable
Quote:
Originally Posted by
Arjay
Look under the 'build' menu for 'Rebuild Solution'.
Thanks for your trouble, however, that menuitem is missing ?
I have: file edit view project debug data tools window help
No build...
Re: Button.Text property not updated in compiled executable
I found the solution to that on google:
http://blogs.vertigo.com/personal/ke...udio-2005.aspx
Unfortunately, the text property is still not updating to the new text, not even after hitting rebuild.
Re: Button.Text property not updated in compiled executable
Re: Button.Text property not updated in compiled executable
Quote:
Originally Posted by
Arjay
Good to know, thanks. :)
No problem.
Anyone else have any suggestions as to why the button text property does not update ?
Re: Button.Text property not updated in compiled executable
check in the designer code whether what ever property you are changing in getting updated for the button , text property...
Re: Button.Text property not updated in compiled executable
Quote:
Originally Posted by
vcdebugger
check in the designer code whether what ever property you are changing in getting updated for the button , text property...
Quote:
//
// button_test_ftp_credentials
//
this.button_test_ftp_credentials.Location = new System.Drawing.Point(33, 341);
this.button_test_ftp_credentials.Name = "button_test_ftp_credentials";
this.button_test_ftp_credentials.Size = new System.Drawing.Size(236, 25);
this.button_test_ftp_credentials.TabIndex = 8;
this.button_test_ftp_credentials.Text = "Test FTP Credentials";
this.button_test_ftp_credentials.UseVisualStyleBackColor = true;
this.button_test_ftp_credentials.Click += new System.EventHandler(this.button_test_credentials_Click);
See, code wise, and Visual studio wise, everything looks correct.
Its just, when running the compiled executeable, the button still says, "Test Credentials"
I checked, for the text "test" , and there are only 2 buttons, which have the text: "test"
The other button is, "Test WEBTOOL credentials" and works fine.
Re: Button.Text property not updated in compiled executable
Image:
http://img833.imageshack.us/img833/9482/48916141.png
Uploaded with ImageShack.us
The one on the right obviously is the visual studio, the one on the right is the executeable in
debug mode.
The button never changes text.
Re: Button.Text property not updated in compiled executable
Search all your source files for "Test Credentials". Make sure to turn off any search filters that may exclude results.
Btw, you have other differences as well. For example "Remote Server" vs. "Remote".
Re: Button.Text property not updated in compiled executable
Quote:
Originally Posted by
Arjay
Search all your source files for "Test Credentials". Make sure to turn off any search filters that may exclude results.
Btw, you have other differences as well. For example "Remote Server" vs. "Remote".
Thank you Arjay, Thou art a genius.
I wrote a small batch script that searches for the relevant text:
Code:
set str=test
set outputfn=test.txt
for /f "tokens=*" %%a in ('dir /b *.cs') do (
set fn=%%a
call :FUNCTION_findstr
)
pause
exit
:FUNCTION_findstr
find /i "%str%" "%fn%">>"%outputfn%"
GOTO:EOF
which resulted in
Quote:
---------- FORM1.CS
private void button_test_credentials_Click(object sender, EventArgs e)
test_ftp_credentials();
private void button_test_webtool_credentials_Click(object sender, EventArgs e)
test_webtool_credentials();
private void test_webtool_credentials()
MessageBox.Show("The test failed, please check if the server is up,\r\nif the pb webtool is configured correctly,\r\nif the webtool URL is correct.", "Test Failed");
MessageBox.Show("Webtool Credentials appear valid :-)", "Test Succeeded!");
MessageBox.Show("Webtool Credentials appear invalid", "Test Failed");
// Check if all FTP credentials are filled in to enable the test credentials button.
button_test_ftp_credentials.Enabled = true;
button_test_ftp_credentials.Enabled = false;
button_test_webtool_credentials.Enabled = true;
button_test_webtool_credentials.Enabled = false;
foreach (string bytestr in bytes)
calc = int.Parse(bytestr);
private void test_ftp_credentials()
ftp_test();
MessageBox.Show("Wrong FTP username / FTP password / host", "Test Failed");
MessageBox.Show("FTP Credentials appear valid :-)", "Test Succeeded!");
private void ftp_test()
button_test_ftp_credentials.Text = "Test Details";
button_test_ftp_credentials.Text = "Test Credentials";
string latestversion = string.Join("", version_arr);
if (int.Parse(latestversion) > int.Parse(internal_version))
where i found: button_test_ftp_credentials.Text = "Test Credentials";
So the property was being changed at run time, and i forgot all about that.
As for the other differences you mentioned in the image, those are not actually different, they just look different.
Sometimes that happens, and i have to bring those controls to the front, and then it appears normal:
http://img225.imageshack.us/img225/2386/sfrdfgsde.png
Uploaded with ImageShack.us
Thank you all for your time!
Re: Button.Text property not updated in compiled executable
Glad you got it figured out.
Btw, Visual Studio has a "Find in files" function built in. It's the folder icon on the toolbar, or you can access it from the "Edit\Find and Replace\Find in files" menu item.
Re: Button.Text property not updated in compiled executable
Quote:
Originally Posted by
Arjay
Glad you got it figured out.
Btw, Visual Studio has a "Find in files" function built in. It's the folder icon on the toolbar, or you can access it from the "Edit\Find and Replace\Find in files" menu item.
Thanks for the tip!