A simpel program

Hi

I'm a newbie in programming, I try to learn as good as I can. I try to write simpel programs, but now I stuck on this problem.

I wanna do a program with a button and a richtextbox, when I press the button the textbox should change, and when i press it again I wannt it to change to sommthing else.

Like this mayby:

First: "hello world"

Seconde: "Don't press me"

third: "Goodby"

Thanks for any (good) answere!

And excuse my english!!!




Answer this question

A simpel program

  • StanStandard

    Hi

    Try something like this:

    Dim Messages() As String = New String(2) {"Hello World", "Don't Press Me!", "Goodbye"}

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

    Static MessageNumber As Integer

    RichTextBox1.Text = Messages(MessageNumber)
    MessageNumber = (1 + MessageNumber) Mod 3

    End Sub

    Dave


  • A simpel program