PJBC
New Member
I'm making an application on Visual Studio 2010 for university and need help
I have to make an application that when text is entered into a text box and a button is pressed, that it then displays the entered text into a label. I have done this so far but now I need to make it so that when no text is entered the default text shows up - this is what I have but I know it's not right so can anybody help?
private void Form1_Load(object sender, EventArgs e)
{
OutputLabel.Text = "Results will show here";
if (OutputLabel.Text = "")
Console.WriteLine("Results will show here");
}
Any help would be appreciated as I have never done C# before and this is only my 2nd week - with that in mind, please keep explanations clear
Pete
I have to make an application that when text is entered into a text box and a button is pressed, that it then displays the entered text into a label. I have done this so far but now I need to make it so that when no text is entered the default text shows up - this is what I have but I know it's not right so can anybody help?
private void Form1_Load(object sender, EventArgs e)
{
OutputLabel.Text = "Results will show here";
if (OutputLabel.Text = "")
Console.WriteLine("Results will show here");
}
Any help would be appreciated as I have never done C# before and this is only my 2nd week - with that in mind, please keep explanations clear
Pete