October 23, 2018
Hot Topics:

Beginning Resource Files

  • November 20, 2002
  • By Kenneth Ives
  • Send Email »
  • More Articles »

Open the code window for this form and paste the following code:

Private Sub Command1_Click()'Here is where we alternate the icons and the captions  If Command1.Caption = "Start" Then    Command1.Picture = LoadResPicture(101, vbResIcon)    Command1.Caption = "Stop"  Else    Command1.Picture = LoadResPicture(102, vbResIcon)    Command1.Caption = "Start"  End If  End SubPrivate Sub Form_Load()' paste the icon on the face of the command button' and set the caption.  Look in the online help for' additional information on the second parameter  Command1.Picture = LoadResPicture(102, vbResIcon)  Command1.Caption = "Start"  Show  End Sub

Press F5 and run it. Click on the button a few times.

I bet you feel that this is an awful lot of running around just to change an icon. Well, it isnt.

Page 4 of 5

Comment and Contribute


(Maximum characters: 1200). You have characters left.



Enterprise Development Update

Don't miss an article. Subscribe to our newsletter below.

By submitting your information, you agree that developer.com may send you developer offers via email, phone and text message, as well as email offers about other products and services that developer believes may be of interest to you. developer will process your information in accordance with the Quinstreet Privacy Policy.


Thanks for your registration, follow us on our social networks to keep up-to-date