Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

Question about command button in Visual Basic?

How can I make a command button in Visual Basic that act like a next command. For example, I made a Command Button named "Next" and Label named "Output" and when I click it, First will be print in Output label, when I click the "Next" again the Output label will print Two and so on.

2 Answers

Relevance
  • Anonymous
    5 years ago

    To only personalize the introduction of the buttons, lower than button houses go with Graphical for form. That way you could change the BG colour upload textual content, and an icon in case you want.

  • 1 decade ago

    If we were to assume that initially label doesn't have any text, following procedure changes it's contents the way you want:

    Private Sub cmdNext_Click() Handles cmdNext.Click

    Select Case lblOutput.Text

    Case "" : lblOutput.Text = "First"

    Case "First" : lblOutput.Text = "Second"

    Case "Second" : lblOutput.Text = "Third"

    Case "Third" : lblOutput.Text = "Fourth"

    Case "Fourth" : lblOutput.Text = "Fifth"

    ' ... you can continue to infinity :)

    End Select

    End Sub

Still have questions? Get your answers by asking now.