Click here to Skip to main content
16,016,570 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I want to change the label text if the first label says access, but its not working when i run the program...

can anyone help
if (Access.Text == "Lollies")
{
    PgeTitle.Text = "Sweets";
}


What I have tried:

if (Access.Text == "Lollies")
{
    PgeTitle.Text = String.Format("Sweets");
}
Posted
Updated 27-Apr-18 11:35am
v2
Comments
BillWoodruff 28-Apr-18 1:01am    
" but its not working" what happens, or does not happen ?

1 solution

Without having a lot more information about the situation it's quite impossible to say why the code isn't running as expected.

In order to investigate (any) situation, it's critical to master using the debugger. Try placing breakpoints on different code lines, investigate the values of the variables etc. This way you learn how to see the program flow and why it behaves as it does.

As a starting point, have a look at Get started with the debugger - Visual Studio | Microsoft Docs[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900