Results 1 to 9 of 9

Thread: Button Event help

  1. #1

    Thread Starter
    Member
    Join Date
    Feb 2004
    Location
    LA
    Posts
    57

    Question Button Event help

    Hello,

    Need some help on how to trigger Button click event. I have to two buttons Button1 and Buttton2. I want to trigger click event in Button1 when I click Button2

    Please help

  2. #2
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    VB Code:
    1. Button1.PerfumeClick()
    something like this

  3. #3
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687
    Go to the handler for the Button1 Click event.
    On the sub header line, at the end, it should say somethign like:
    "...Handles Button1.Click"
    Add ", Button2.Click" to the end of it.
    Now Button1 and Button2 will call the same event handler for the click event.

    TG
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  4. #4

    Thread Starter
    Member
    Join Date
    Feb 2004
    Location
    LA
    Posts
    57
    Hello Pirate,

    Code:
    Button1.PerfumeClick()
    Works good if the buttons are on the form .But if the buttons are on the different tabs it does not work. Do you now how to make it work for buttons on different tabs

    Thank you.

  5. #5
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Any of these should work .
    VB Code:
    1. Me.Button1_Click(sender, e)
    2. 'or
    3. Me.Button1_Click(Me, e)
    4. 'or
    5. Me.Button1_Click(Nothing, Nothing)

  6. #6
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    Originally posted by Pirate
    VB Code:
    1. Button1.PerfumeClick()
    something like this
    I didn't know that Buttons could click Perfume bottles.

  7. #7

    Thread Starter
    Member
    Join Date
    Feb 2004
    Location
    LA
    Posts
    57
    Thank you guys for you help.

  8. #8
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Originally posted by mendhak
    I didn't know that Buttons could click Perfume bottles.
    lol ...............

    I meant this one
    VB Code:
    1. me.Button1.PerformClick

  9. #9
    PowerPoster
    Join Date
    Dec 2003
    Location
    Bristol, England (but heart is in Virginia)
    Posts
    2,949
    Hi,


    " didn't know that Buttons could click Perfume bottles. "


    Microsoft had to include it cos VB.NET coding stinks
    Taxes
    The more I learn about VB.NET the more I like dBaseIII Plus

    The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width