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.
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
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
---------- 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:
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
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.
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.