"method or data member not found" using Toolbar button

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • SammyB
    Recognized Expert Contributor
    • Mar 2007
    • 807

    #16
    Originally posted by kkk1979
    How do I check whether all the required members of button are present in my project ??
    :confused: Since you are using a non-standard toolbar, we have no way of knowing. Please do what my last post said.

    Comment

    • kkk1979
      New Member
      • Mar 2007
      • 23

      #17
      Thank you for your help.That is the reason. But how can I include the members to the button ?

      Comment

      • kkk1979
        New Member
        • Mar 2007
        • 23

        #18
        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 help

        Comment

        • rowen33
          New Member
          • Mar 2007
          • 3

          #19
          I think in object oriented programming such as Visual Basic .Net you can add your own custom methods to the Button Class. That is all I remember... Roger

          Comment

          • Killer42
            Recognized Expert Expert
            • Oct 2006
            • 8429

            #20
            Originally posted by kkk1979
            I 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.

            Code:
            select case button.key
            case "btn1"
                   msgbox ""
            case "btn2"
                  msgbox ""
            end
            end select
            Can anybody help me in figuring out this problem
            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.

            Comment

            • Killer42
              Recognized Expert Expert
              • Oct 2006
              • 8429

              #21
              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 Sub

              Comment

              • kenobewan
                Recognized Expert Specialist
                • Dec 2006
                • 4871

                #22
                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

                • Killer42
                  Recognized Expert Expert
                  • Oct 2006
                  • 8429

                  #23
                  Originally posted by kkk1979
                  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.
                  When you select Button in the object browser, what does it show in the grey window down the bottom?

                  (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

                  Working...