Results 1 to 7 of 7

Thread: Resolved - calling button code by menu item click

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 2004
    Location
    india
    Posts
    88

    Question Resolved - calling button code by menu item click

    I have a working button code.
    I would like to call same by clicking menu list item.
    how do I do it?
    Last edited by santosh66; Oct 19th, 2004 at 10:46 PM.

  2. #2
    VB6, XHTML & CSS hobbyist Merri's Avatar
    Join Date
    Oct 2002
    Location
    Finland
    Posts
    6,654
    VB Code:
    1. Private Sub mnuFileNew_Click()
    2.     Command1_Click
    3. End Sub






    Edit Ha! Faster by three minutes!
    Last edited by Merri; Sep 30th, 2004 at 10:57 PM.

  3. #3
    PowerPoster lintz's Avatar
    Join Date
    Mar 2003
    Location
    The 19th Hole
    Posts
    2,697
    Try this....

    VB Code:
    1. Private Sub YourMenu_Click()
    2. 'Call Working Button Code
    3.  
    4. 'If the code is in the click event of a button try this
    5. MyButton_Click
    6. End Sub

  4. #4
    Frenzied Member Spajeoly's Avatar
    Join Date
    Mar 2003
    Location
    Utah
    Posts
    1,068
    You can also say....
    VB Code:
    1. Command1.Value = True

    Though I know of no one else who does it like that

  5. #5
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758
    I use the Value property to fire the click event.

  6. #6
    Next Of Kin baja_yu's Avatar
    Join Date
    Aug 2002
    Location
    /dev/root
    Posts
    5,989
    But if you have code in any other events put them instead of Click, like:

    VB Code:
    1. Command1_KeyPress
    2. Command1_MouseDown

    etc...

  7. #7
    Frenzied Member pnish's Avatar
    Join Date
    Aug 2002
    Location
    Tassie, Oz
    Posts
    1,918
    Originally posted by brucevde
    I use the Value property to fire the click event.
    Ditto here. So Spajeoly you now know 2 people who do it that way.
    Pete

    No trees were harmed in the making of this post, however a large number of electrons were greatly inconvenienced.

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