Originally posted by kkk1979
"method or data member not found" using Toolbar button
Collapse
X
-
I looked for the methods of button object in Object Browser, then compared with other system's Button Object. So I found that my system has no methods for button object. Is it possible to add the methods to my system too ? Can you please check it
Thank you very much for your helpComment
-
Sorry, I haven't followed the rest of the thread yet (short of time) but if you have defined button as anything, that is probably your problem. If this is the type of toolbar I'm familiar with, Button should represent the parameter (ByVal Button As MSComctlLib.But ton) which is received when this event procedure is called.Originally posted by kkk1979I am not an experienced programmer. I am getting an error as "method or data member not found" when i entered the following code in buttonclick procedure of the toolbar.
Can anybody help me in figuring out this problemCode:select case button.key case "btn1" msgbox "" case "btn2" msgbox "" end end selectComment
-
Oops! Looks as though I spoke too soon.
Are you sure you don't have some custom object you're created (or a form or whatever) called "Button"?
Here's an exercise which might (or might not) help. Change the name of the parameter to something which you know won't match anything else. For example...Code:Private Sub Toolbar1_ButtonClick(ByVal [B]KillerSaidToDoThis[/B] As MSComctlLib.Button) Debug.Print [B]KillerSaidToDoThis[/B].Index, [B]KillerSaidToDoThis[/B].Caption, _ [B]KillerSaidToDoThis[/B].Key End SubComment
-
I believe that we are reaching the end of how much help we can provide here. Clear step by step instructions have been given.
We all started somewhere and there is no shame in being a newbie. My suggestion is find a book or course and learn the basics. This is a site for programmers and not geared to learning the basics - it is assumed by the experts that you have this.
So please learn the fundamentals, it will save you time in the log run. I am sure we could suggest some resources if you like. Thanks.Comment
-
When you select Button in the object browser, what does it show in the grey window down the bottom?Originally posted by kkk1979I looked for the methods of button object in Object Browser, then compared with other system's Button Object. So I found that my system has no methods for button object.
(Note, I've updated the title of the thread - "Hi All" won't help anyone in the future who needs to search for help on this topic).Comment
Comment