Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6535447
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T10:22:30+00:00 2026-05-25T10:22:30+00:00

In VB6 I need to know how to call a button click event on

  • 0

In VB6 I need to know how to call a button click event on anther form. The another form part is easy but how to pass the click event the proper method to “click” the right button on the toolbar is the real issue.

Here is the vent on the main form – i need to call the click event case “Copyfrom”.

MainForm

Public Sub tbrMain_ButtonClick(ByVal Button As MSComctlLib.Button)

Select Case Button.Index
  Case ToolBarItem.tbPrint

    '(some code)

  Case ToolBarItem.tbSave

    '(some code)

  Case ToolBarItem.tbCopyFrom

    '(some code)

   Case ToolBarItem.tbNEW

    '(etc)

I tried

Mainform.tbrMain_ButtonClick() 

and even tried passing the index number and key – no dice.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T10:22:30+00:00Added an answer on May 25, 2026 at 10:22 am

    The event handler is expecting to receive a reference to an actual toolbar button, so you have to pass the toolbar button itself, not it’s Caption or Key, e.g.:

        Form1.tbrMain_ButtonClick Form1.tbrMain.Buttons(1)
    

    Or, using the Call statement:

        Call Form1.tbrMain_ButtonClick(Form1.tbrMain.Buttons(1))
    

    If you set the Key properties on your toolbar buttons, you can use the Key property of the desired button in place of the (1):

        Form1.tbrMain_ButtonClick Form1.tbrMain.Buttons("PrintButton")
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know that VB6 is a very old compiler, but i need to know
I have a VB6 COM component which I need to call from my .Net
I used to know vb6 and I need to make a quick application. I
I need to pass data between a vb6 app and a .net app. This
I know a lot of question regarding VB6 migration have been asked, but I
I need to create an ActiveX DLL (not a control). I know that VB6
Using VB6 I am using checkbox and combobox in a Form. When i click
I need to subclass a VB6 form so that if the user hits the
I need to consume an external web service from my VB6 program. I want
I need to allow the vertical scrollbar in a multiselect listbox (VB6) however, when

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.