Results 1 to 6 of 6

Thread: [RESOLVED] Using keyboard to activate Command Button

  1. #1

    Thread Starter
    Hyperactive Member Tarablue's Avatar
    Join Date
    Feb 2007
    Location
    Somewhere West of GMT
    Posts
    398

    Resolved [RESOLVED] Using keyboard to activate Command Button

    In my program I have several Combo boxes that need input from the user before you can proceed. Some of these have default values so after the first two have data a command button becomes active. It's at this stage that I would like too offer the use of the Enter Key to activate the command button instead of using a mouse click.

    Can anyone help with some code on this.

    Thanks
    Tarablue

  2. #2
    Frenzied Member
    Join Date
    Jun 2006
    Posts
    1,098

    Re: Using keyboard to activate Command Button

    CommandButton.Default = True

  3. #3

    Thread Starter
    Hyperactive Member Tarablue's Avatar
    Join Date
    Feb 2007
    Location
    Somewhere West of GMT
    Posts
    398

    Re: Using keyboard to activate Command Button

    Well that's incredable. I was expecting several lines of code which I would have to read over several times in order to get a handle on what's going on.

    Thanks again Logophobic
    rgds
    Tarablue

  4. #4
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: Using keyboard to activate Command Button

    You can also set it during design time.

    -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??? *

  5. #5

    Thread Starter
    Hyperactive Member Tarablue's Avatar
    Join Date
    Feb 2007
    Location
    Somewhere West of GMT
    Posts
    398

    Re: Using keyboard to activate Command Button

    TechGnome,

    Thank you for that, I'll give it a try.

    In the mean time can you look at my other problem 'Big Select in MSFlexGrid' which is causing me some concern

    Tarablue
    Last edited by Tarablue; Feb 21st, 2007 at 11:20 PM.

  6. #6
    Discovering Life Siddharth Rout's Avatar
    Join Date
    Feb 2005
    Location
    Mumbai, India
    Posts
    12,001

    Re: Using keyboard to activate Command Button

    In my program I have several Combo boxes that need input from the user before you can proceed. Some of these have default values so after the first two have data a command button becomes active. It's at this stage that I would like too offer the use of the Enter Key to activate the command button instead of using a mouse click.

    Can anyone help with some code on this.
    You can also make use of the .accelerator property
    A good exercise for the Heart is to bend down and help another up...
    Please Mark your Thread "Resolved", if the query is solved


    MyGear:
    ★ CPU ★ Ryzen 5 5800X
    ★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
    ★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
    ★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
    ★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
    ★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
    ★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
    ★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
    ★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
    ★ Keyboard ★ TVS Electronics Gold Keyboard
    ★ Mouse ★ Logitech G502 Hero

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