|
-
Jul 14th, 2000, 09:09 AM
#1
Thread Starter
Hyperactive Member
I have a toolbar with a GO sign on one of the buttons. When you click it, I want it to change to a STOP sign. I have both images in the imagelist, but cannot figure out the code to change the GO sign to a STOP sign. Here is what I have:
If startstop% = 1 Then
Toolbar1.Buttons(10).ToolTipText = "Start Execution"
Toolbar1.Buttons(10).Image = ImageList1.ListImages(10)
ElseIf startstop% = 2 Then
Toolbar1.ToolTipText = "Stop Execution"
Toolbar1.Buttons(10).Image = ImageList1.ListImages(14)
End If
But this is giving me Run Time error 35603 'Invalid Key'
What am I doing wrong?? Thanks for any help.
-
Jul 14th, 2000, 09:23 AM
#2
Fanatic Member
Why don't you have two toolbar buttons with the different images and make only one visible at a time.
When one is pressed make it invisible and the other visible.
-
Jul 14th, 2000, 09:25 AM
#3
Lively Member
Damn Stevie, just beat me to it!
//Anders
-
Jul 14th, 2000, 09:27 AM
#4
Fanatic Member
Gotta be quick round here mate, happens to me all the time.
-
Jul 14th, 2000, 09:38 AM
#5
You got an Invalid Key error because you did not specify a Key for the ListImage.
Code:
Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
If Button.Key = "Stop" Then
Button.Image = ImageList1.ListImages(2).Key
End If
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|