Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. CBitmapButton not taking keyboard inputs.

CBitmapButton not taking keyboard inputs.

Scheduled Pinned Locked Moved C / C++ / MFC
tutorial
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    User 3831761
    wrote on last edited by
    #1

    Hi, I have changed the normal dialog button to owner draw and used CBitmapButton. But when the focus is on the button and when we hit enter it is not taking the keyboard input. When we remove the owner draw, keyboard input works. Can someone let me know how to enable keyboard input when the button is Owner draw and use CBitmapButton to place image on it. Thanks in advance.. Ram..

    A 1 Reply Last reply
    0
    • U User 3831761

      Hi, I have changed the normal dialog button to owner draw and used CBitmapButton. But when the focus is on the button and when we hit enter it is not taking the keyboard input. When we remove the owner draw, keyboard input works. Can someone let me know how to enable keyboard input when the button is Owner draw and use CBitmapButton to place image on it. Thanks in advance.. Ram..

      A Offline
      A Offline
      Aescleal
      wrote on last edited by
      #2

      Is the control recieving a WM_KEYDOWN when you bash enter when the focus is on it? From what I remember of using BS_OWNERDRAW controls years ago you have to handle the keyboard messages yourself. Unlike BS_PUSHBUTTON the control doesn't generate BN_CLICKED notifications from someone pressing return/enter or space. My first line of enquiry would be to override OnKeyDown in the button class and see what happens. If that's called then override OnKeyUp and send the button's parent a WM_COMMAND/BN_CLICKED when the enter or space key are released. Cheers, Ash

      modified on Monday, September 20, 2010 11:39 AM

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups