How can be a commond button's caption changed

Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Jul 2005
Posts: 19
Reputation: user777 is an unknown quantity at this point 
Solved Threads: 0
user777 user777 is offline Offline
Newbie Poster

How can be a commond button's caption changed

 
0
  #1
Sep 15th, 2005
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.
Reply With Quote Quick reply to this message  
Join Date: Jun 2005
Posts: 121
Reputation: jwshepherd is an unknown quantity at this point 
Solved Threads: 5
jwshepherd's Avatar
jwshepherd jwshepherd is offline Offline
Junior Poster

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

 
0
  #2
Sep 15th, 2005
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
.: We may acquire liberty, but it is never recovered if it is lost :.
irc://irc.rizon.net/#itf
Reply With Quote Quick reply to this message  
Join Date: Jul 2005
Posts: 19
Reputation: user777 is an unknown quantity at this point 
Solved Threads: 0
user777 user777 is offline Offline
Newbie Poster

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

 
0
  #3
Sep 17th, 2005
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.
Reply With Quote Quick reply to this message  
Join Date: Jun 2005
Posts: 121
Reputation: jwshepherd is an unknown quantity at this point 
Solved Threads: 5
jwshepherd's Avatar
jwshepherd jwshepherd is offline Offline
Junior Poster

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

 
0
  #4
Sep 18th, 2005
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
.: We may acquire liberty, but it is never recovered if it is lost :.
irc://irc.rizon.net/#itf
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:




Views: 3620 | Replies: 3
Thread Tools Search this Thread



Tag cloud for Visual Basic 4 / 5 / 6
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC