944,099 Members | Top Members by Rank

Ad:
Sep 15th, 2005
0

How can be a commond button's caption changed

Expand Post »
Hi,

I would like to change the caption of "ADD COMMOND BUTTON" to "SAVE" when it is pressed at run time.

Could somebody is there to help me in this regard.

Thanks in advance.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
user777 is offline Offline
19 posts
since Jul 2005
Sep 15th, 2005
0

Re: How can be a commond button's caption changed

Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. Public Sub Command1_Click()
  2. if command1.caption = "SAVE" Then
  3. command1.caption = "ADD COMMOND BUTTON"
  4. 'Put Save commands here
  5. else
  6. Command1.caption ="SAVE"
  7. 'put ADD COMMOND BUTTON Commands here
  8. end if
  9. end sub
Reputation Points: 20
Solved Threads: 5
Junior Poster
jwshepherd is offline Offline
123 posts
since Jun 2005
Sep 17th, 2005
0

Re: How can be a commond button's caption changed

Quote originally posted by jwshepherd ...
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. Public Sub Command1_Click()
  2. if command1.caption = "SAVE" Then
  3. command1.caption = "ADD COMMOND BUTTON"
  4. 'Put Save commands here
  5. else
  6. Command1.caption ="SAVE"
  7. 'put ADD COMMOND BUTTON Commands here
  8. end if
  9. end sub
------------------------------------------------------------------
Dear Sir,

Thanks for your kind reply. If I press the Save button it should change the caption "save" to "add" and when i again press the button "add" it should change its caption "add" to "save". please help.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
user777 is offline Offline
19 posts
since Jul 2005
Sep 18th, 2005
0

Re: How can be a commond button's caption changed

Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. Option Explicit
  2.  
  3. Public Sub Command1_Click()
  4. If Command1.Caption = "SAVE" Then
  5. Command1.Caption = "ADD"
  6. 'Put Save commands here
  7. Else
  8. Command1.Caption = "SAVE"
  9. 'put ADD COMMOND BUTTON Commands here
  10. End If
  11. End Sub
Reputation Points: 20
Solved Threads: 5
Junior Poster
jwshepherd is offline Offline
123 posts
since Jun 2005

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 Visual Basic 4 / 5 / 6 Forum Timeline: Reposition Event??
Next Thread in Visual Basic 4 / 5 / 6 Forum Timeline: Search code ...





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


Follow us on Twitter


© 2011 DaniWeb® LLC