newb question

so i have to make a windows application that displays 2 texts over and over again using a button in the interface, and i think i need a loop, but not sure how this is done for text.
/code
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace WindowsApplication1
{
public partial class change_test : Form
{
public change_test()
{
InitializeComponent();
}

private void Form1_Load(object sender, EventArgs e)
{

}

private void btn_change_Click(object sender, EventArgs e)
{


if (lblTop = "Life is not fun when it does not change.")
lblTop.Text="Change is Good for the Soul.";
else
lblTop.Text = "Life is not fun when it does not change.";
}
}
}
/code
ok, and i still need help on how to post codes
[1140 byte] By [peter449] at [2007-11-20 11:07:11]
# 1 Re: newb question
Put the word code in between [ and ].
:)

The compiler error is because you are assigning instead of comparing.

What you need is:

if (lblTop == "Life is not fun when it does not change.")
Zaccheus at 2007-11-9 11:36:19 >
# 2 Re: newb question
...lol
uuuuumm
how embarrassing...
peter449 at 2007-11-9 11:37:20 >
# 3 Re: newb question
acctually, i just tried it again, it saids Operator'=='cannot be applied to operands of type'System.Windows.Forms.Label'and 'string'
anyone else have some input?
peter449 at 2007-11-9 11:38:19 >
# 4 Re: newb question
:)

I failed to notice that you also need to write lblTop.Text in the if statement:
if (lblTop.Text == "Life is not fun when it does not change.")

:o
Zaccheus at 2007-11-9 11:39:24 >
# 5 Re: newb question
thanks, it works, but can you show me how i can make the label show more than 2 texts and repeat? when i try to put 2 .Text commands it just ends up doing the latter one.
peter449 at 2007-11-9 11:40:23 >
# 6 Re: newb question
Can you show me your code?
Zaccheus at 2007-11-9 11:41:23 >