Since you are learning, I will take a little time to try and explain in a very basic way. If you don't understand, ask questions till you do. Best way to learn!!!
Now, its not a good idea to write code that way. the idea is to check if label1.Text
is equal to "Its Hot outside"
OR label1.Text
is equal to "Its warm outside"
.
In regular English expression you can say it as it is but in programming, computers are not that smart(FACT), they need everything to be told them in clear language. this is called logics.
With this, a better logic to do this is;
if (label1.Text == "Its Hot outside" || label1.Text == "Its warm outside")
{
//picture of a sun
picturebox.Show();
}
What you have initially done is saying
If label1.Text
is equal to the string "Its Hot outside"
OR if "Its warm outside"
. the last part is not evaluated as a boolean, it's a string, which is the cause for the exception message: "Operator || cannot be applied to operands of type bool and string". Both operands must be boolean types.
What I have done is saying;
If label1.Text
is equal to the string "Its Hot outside"
OR
If label1.Text
is equal to the string "Its warm outside"
So it checks label1.Text
against each string provided.
And this is really how to build logics for a computer.
This link could do you some good: https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/