943,028 Members | Top Members by Rank

Ad:
  • VB.NET Discussion Thread
  • Unsolved
  • Views: 306
  • VB.NET RSS
Mar 19th, 2010
0

Multi functional label

Expand Post »
hello
I have strings here, ecah stored individually
a = hello
b = bye
c= hi

Label1.text = a
label1.text = b
label1.text = c
it is in the command button sub and i want them to show respectively when the button is clicked like this:
a first, then b, then c.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Light Poster
london-G is offline Offline
32 posts
since Feb 2010
Mar 19th, 2010
0
Re: Multi functional label
I think you forgot to ask a question.
Moderator
Reputation Points: 2134
Solved Threads: 1227
Posting Genius
adatapost is offline Offline
6,524 posts
since Oct 2008
Mar 22nd, 2010
0
Re: Multi functional label
Try this in the command buttons click event:
VB.NET Syntax (Toggle Plain Text)
  1. Private buttonClickIndex As Integer = 0
  2.  
  3. Private Sub Command1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
  4. If buttonClickIndex = 0 Then
  5. label1.Text = "hello"
  6. buttonClickIndex = 1
  7. ElseIf buttonClickIndex = 1
  8. label1.Text = "bye"
  9. buttonClickIndex = 2
  10. ElseIf buttonClickIndex = 2
  11. label1.Text = "hi"
  12. buttonClickIndex = 0
  13. End If
  14. End Sub
Click to Expand / Collapse  Quote originally posted by london-G ...
hello
I have strings here, ecah stored individually
a = hello
b = bye
c= hi

Label1.text = a
label1.text = b
label1.text = c
it is in the command button sub and i want them to show respectively when the button is clicked like this:
a first, then b, then c.
Reputation Points: 87
Solved Threads: 128
Practically a Master Poster
Oxiegen is offline Offline
651 posts
since Jun 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in VB.NET Forum Timeline: Select from where
Next Thread in VB.NET Forum Timeline: Data Type Mismatch





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC