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

  • Home
  • SEARCH
  • 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 121393
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T03:57:49+00:00 2026-05-11T03:57:49+00:00

I have the same problem as described in the posts listed below. That is,

  • 0

I have the same problem as described in the posts listed below. That is, certain keys don’t work at all when I type them into my combobox until I first hit the spacebar. One of the keys is ‘.’, but another is the letter ‘Q’, and there are others: ‘$’, ‘%’.

http://forums.microsoft.com/msdn/ShowPost.aspx?PostID=659716&SiteID=1
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2909173&SiteID=1&pageid=0
http://bytes.com/forum/thread548399.html

I’ve tried a lot of things so far. My latest failure was based on the theory that maybe the DataGridView was using WIN32 API wndproc subclassing to intercept messages, so I wrote logic to save the old wndproc and restore it after adding it to the DataGridView’s control collection. That didn’t work.

Messina – thanks for reminding me about Spy++. For the letter ‘A’, the edit window sends an EN_UPDATE to its combobox parent. But, not for the ‘Q’. That’s so strange.

I have convinced myself that the DataGridView is not subclassing the combo and the edit, because I check the address of the wndprocs just after creation and before adding them to the grid’s collection, and then later when I paint. Unless the grid installs some sort of global hooks..

I’m thinkin, maybe I can subclass the edit control, and then send the notification to the combobox the way I see the edit control doing here?

EDIT: More info here. Windows messages from grid, combobox, and edit control, from Spy++:

HWNDs: 122064e < grid 010d0674 < combobox 01360696 < combox’s edit control

<01402> 01360696 P WM_KEYDOWN nVirtKey:'A' cRepeat:1 ScanCode:1E fExtended:0 fAltDown:0 fRepeat:0 fUp:0 <01403> 010D0674 S WM_GETDLGCODE <01404> 010D0674 R WM_GETDLGCODE fuDlgCode:DLGC_WANTARROWS | DLGC_WANTCHARS <01405> 010D0674 S WM_GETDLGCODE <01406> 010D0674 R WM_GETDLGCODE fuDlgCode:DLGC_WANTARROWS | DLGC_WANTCHARS <01407> 010D0674 S WM_GETDLGCODE <01408> 010D0674 R WM_GETDLGCODE fuDlgCode:DLGC_WANTARROWS | DLGC_WANTCHARS <01409> 010D0674 S WM_GETDLGCODE <01410> 010D0674 R WM_GETDLGCODE fuDlgCode:DLGC_WANTARROWS | DLGC_WANTCHARS <01411> 01360696 P WM_CHAR chCharCode:'0061' (97) cRepeat:1 ScanCode:1E fExtended:0 fAltDown:0 fRepeat:0 fUp:0 <01412> 010D0674 S WM_GETDLGCODE <01413> 010D0674 R WM_GETDLGCODE fuDlgCode:DLGC_WANTARROWS | DLGC_WANTCHARS <01414> 010D0674 S WM_GETDLGCODE <01415> 010D0674 R WM_GETDLGCODE fuDlgCode:DLGC_WANTARROWS | DLGC_WANTCHARS  <01416> 010D0674 S WM_COMMAND wNotifyCode:EN_UPDATE wID:1001 hwndCtl:01360696  <<< edit control sends to combobox  <01417> 010D0674 S message:0x2111 [User-defined:WM_USER+7441] wParam:00060674 lParam:010D0674    What do these do? <01418> 010D0674 R message:0x2111 [User-defined:WM_USER+7441] lResult:00000000  <01419> 010D0674 R WM_COMMAND <01420> 010D0674 S WM_CTLCOLOREDIT hdcEdit:C7011AA6 hwndEdit:01360696 <01421> 010D0674 R WM_CTLCOLOREDIT hBrush:F0103EB0  <01422> 010D0674 S WM_COMMAND wNotifyCode:EN_CHANGE wID:1001 hwndCtl:01360696  << edit control sends to combobox  <01423> 010D0674 S message:0x2111 [User-defined:WM_USER+7441] wParam:00050674 lParam:010D0674  <01424> 0122064E S WM_PAINT hdc:00000000   <<< grid is told to paint <01425> 0122064E S WM_ERASEBKGND hdc:94011D4E <01426> 0122064E R WM_ERASEBKGND fErased:True <01427> 0122064E S WM_GETTEXTLENGTH <01428> 0122064E R WM_GETTEXTLENGTH cch:0 <01429> 0122064E S WM_GETTEXT cchTextMax:2 lpszText:0012D0C0 <01430> 0122064E R WM_GETTEXT cchCopied:0 lpszText:0012D0C0 ('') <01431> 0122064E S WM_GETTEXTLENGTH <01432> 0122064E R WM_GETTEXTLENGTH cch:0 <01433> 0122064E S WM_GETTEXT cchTextMax:2 lpszText:0012D0C0 <01434> 0122064E R WM_GETTEXT cchCopied:0 lpszText:0012D0C0 ('') <01435> 010D0674 S WM_WINDOWPOSCHANGING lpwp:0012D4B0 <01436> 010D0674 R WM_WINDOWPOSCHANGING <01437> 010D0674 S CB_GETCURSEL <01438> 010D0674 R CB_GETCURSEL index:CB_ERR <01439> 010D0674 S WM_GETTEXTLENGTH <01440> 01360696 S WM_GETTEXTLENGTH <01441> 01360696 R WM_GETTEXTLENGTH cch:2 <01442> 010D0674 R WM_GETTEXTLENGTH cch:2 <01443> 010D0674 S WM_GETTEXT cchTextMax:6 lpszText:0012CC44 <01444> 01360696 S WM_GETTEXT cchTextMax:6 lpszText:0012BE64 <01445> 01360696 R WM_GETTEXT cchCopied:2 lpszText:0012BE64 ('a') <01446> 010D0674 R WM_GETTEXT cchCopied:2 lpszText:0012CC44 ('a') <01447> 010D0674 S CB_GETCURSEL <01448> 010D0674 R CB_GETCURSEL index:CB_ERR <01449> 010D0674 S WM_GETTEXTLENGTH <01450> 01360696 S WM_GETTEXTLENGTH <01451> 01360696 R WM_GETTEXTLENGTH cch:2 <01452> 010D0674 R WM_GETTEXTLENGTH cch:2 <01453> 010D0674 S WM_GETTEXT cchTextMax:6 lpszText:0012CC44 <01454> 01360696 S WM_GETTEXT cchTextMax:6 lpszText:0012BE64 <01455> 01360696 R WM_GETTEXT cchCopied:2 lpszText:0012BE64 ('a') <01456> 010D0674 R WM_GETTEXT cchCopied:2 lpszText:0012CC44 ('a') <01457> 010D0674 S CB_GETCURSEL <01458> 010D0674 R CB_GETCURSEL index:CB_ERR <01531> 0122064E R WM_PAINT <01532> 010D0674 S WM_PAINT hdc:00000000 <01533> 010D0674 S WM_NCPAINT hrgn:00000001 <01534> 010D0674 R WM_NCPAINT <01535> 010D0674 S WM_ERASEBKGND hdc:0F0141ED <01536> 010D0674 R WM_ERASEBKGND fErased:True <01537> 0122064E S WM_CTLCOLOREDIT hdcEdit:840137F1 hwndEdit:010D0674 <01538> 0122064E R WM_CTLCOLOREDIT hBrush:F0103EB0 <01539> 010D0674 R WM_PAINT <01540> 01360696 S WM_PAINT hdc:00000000 <01541> 01360696 S WM_NCPAINT hrgn:00000001 <01542> 01360696 R WM_NCPAINT <01543> 01360696 S WM_ERASEBKGND hdc:C7011AA6 <01544> 01360696 R WM_ERASEBKGND fErased:True <01545> 010D0674 S WM_CTLCOLOREDIT hdcEdit:870137F1 hwndEdit:01360696 <01546> 010D0674 R WM_CTLCOLOREDIT hBrush:F0103EB0 <01547> 010D0674 S WM_CTLCOLOREDIT hdcEdit:870137F1 hwndEdit:01360696 <01548> 010D0674 R WM_CTLCOLOREDIT hBrush:F0103EB0 <01549> 01360696 R WM_PAINT <01555> 0122064E S WM_CTLCOLOREDIT hdcEdit:8A0137F1 hwndEdit:010306AC <01556> 0122064E R WM_CTLCOLOREDIT hBrush:78103C5B <01568> 010D0674 S CB_GETCURSEL <01569> 010D0674 R CB_GETCURSEL index:CB_ERR <01570> 010D0674 S WM_GETTEXTLENGTH <01571> 01360696 S WM_GETTEXTLENGTH <01572> 01360696 R WM_GETTEXTLENGTH cch:2 <01573> 010D0674 R WM_GETTEXTLENGTH cch:2 <01574> 010D0674 S WM_GETTEXT cchTextMax:6 lpszText:0012D7A4 <01575> 01360696 S WM_GETTEXT cchTextMax:6 lpszText:0012C9C4 <01576> 01360696 R WM_GETTEXT cchCopied:2 lpszText:0012C9C4 ('a') <01577> 010D0674 R WM_GETTEXT cchCopied:2 lpszText:0012D7A4 ('a') <01578> 010D0674 S CB_GETCURSEL <01579> 010D0674 R CB_GETCURSEL index:CB_ERR <01580> 010D0674 S WM_GETTEXTLENGTH <01581> 01360696 S WM_GETTEXTLENGTH <01582> 01360696 R WM_GETTEXTLENGTH cch:2 <01583> 010D0674 R WM_GETTEXTLENGTH cch:2 <01584> 010D0674 S WM_GETTEXT cchTextMax:6 lpszText:0012D6E0 <01585> 01360696 S WM_GETTEXT cchTextMax:6 lpszText:0012C900 <01586> 01360696 R WM_GETTEXT cchCopied:2 lpszText:0012C900 ('a') <01587> 010D0674 R WM_GETTEXT cchCopied:2 lpszText:0012D6E0 ('a') <01588> 010D0674 S CB_GETCURSEL <01589> 010D0674 R CB_GETCURSEL index:CB_ERR <01590> 010D0674 S WM_GETTEXTLENGTH <01591> 01360696 S WM_GETTEXTLENGTH <01592> 01360696 R WM_GETTEXTLENGTH cch:2 <01593> 010D0674 R WM_GETTEXTLENGTH cch:2 <01594> 010D0674 S WM_GETTEXT cchTextMax:6 lpszText:0012D6E0 <01595> 01360696 S WM_GETTEXT cchTextMax:6 lpszText:0012C900 <01596> 01360696 R WM_GETTEXT cchCopied:2 lpszText:0012C900 ('a') <01597> 010D0674 R WM_GETTEXT cchCopied:2 lpszText:0012D6E0 ('a') <01598> 010D0674 R message:0x2111 [User-defined:WM_USER+7441] lResult:00000000 <01599> 01360696 S WM_GETTEXTLENGTH <01600> 01360696 R WM_GETTEXTLENGTH cch:2 <01601> 01360696 S WM_GETTEXT cchTextMax:6 lpszText:0012DF8C <01602> 01360696 R WM_GETTEXT cchCopied:2 lpszText:0012DF8C ('a') <01603> 010D0674 R WM_COMMAND <01604> 01360696 P WM_KEYUP nVirtKey:'A' cRepeat:1 ScanCode:1E fExtended:0 fAltDown:0 fRepeat:1 fUp:1 

Letter q

<01625> 01360696 P WM_KEYDOWN nVirtKey:'Q' cRepeat:1 ScanCode:10 fExtended:0 fAltDown:0 fRepeat:0 fUp:0 <01626> 010D0674 S WM_GETDLGCODE <01627> 010D0674 R WM_GETDLGCODE fuDlgCode:DLGC_WANTARROWS | DLGC_WANTCHARS <01628> 010D0674 S WM_GETDLGCODE <01629> 010D0674 R WM_GETDLGCODE fuDlgCode:DLGC_WANTARROWS | DLGC_WANTCHARS <01630> 010D0674 S WM_GETDLGCODE <01631> 010D0674 R WM_GETDLGCODE fuDlgCode:DLGC_WANTARROWS | DLGC_WANTCHARS <01632> 010D0674 S WM_GETDLGCODE <01633> 010D0674 R WM_GETDLGCODE fuDlgCode:DLGC_WANTARROWS | DLGC_WANTCHARS <01634> 01360696 P WM_CHAR chCharCode:'0071' (113) cRepeat:1 ScanCode:10 fExtended:0 fAltDown:0 fRepeat:0 fUp:0 <01635> 010D0674 S WM_GETDLGCODE <01636> 010D0674 R WM_GETDLGCODE fuDlgCode:DLGC_WANTARROWS | DLGC_WANTCHARS <01637> 010D0674 S WM_GETDLGCODE <01638> 010D0674 R WM_GETDLGCODE fuDlgCode:DLGC_WANTARROWS | DLGC_WANTCHARS <01640> 01360696 P WM_KEYUP nVirtKey:'Q' cRepeat:1 ScanCode:10 fExtended:0 fAltDown:0 fRepeat:1 fUp:1 
  • 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. 2026-05-11T03:57:50+00:00Added an answer on May 11, 2026 at 3:57 am

    By any chance, have you already solved your problem?

    I have the same problem as yours, my custom control for DataGridView cannot receive letter Q, period, dollar, single quote, percent, etc.

    I was able to solve the problem by changing the ‘switch .. default: return false’ to ‘switch .. default: return !dataGridViewWantsInputKey’

    I guess the pattern code from Microsoft for making your own usercontrol for datagridview is not optimal. This is the pattern code from Microsoft:

    http://msdn.microsoft.com/en-au/library/7tas5c80(vs.80).aspx

    public bool EditingControlWantsInputKey(     Keys key, bool dataGridViewWantsInputKey) {     // Let the DateTimePicker handle the keys listed.     switch (key & Keys.KeyCode)     {         case Keys.Left:         case Keys.Up:         case Keys.Down:         case Keys.Right:         case Keys.Home:         case Keys.End:         case Keys.PageDown:         case Keys.PageUp:             return true;         default:             return false; // I changed this to: return !dataGridViewWantsInputKey.  My usercontrol can now receive Q, period, dollar, etc.     } } 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 99k
  • Answers 99k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer This is tricky, as "last element" isn't a Markov stopping… May 11, 2026 at 7:40 pm
  • Editorial Team
    Editorial Team added an answer Put your web service into separate directory and put additional… May 11, 2026 at 7:40 pm
  • Editorial Team
    Editorial Team added an answer Here is an example of doing that in .NET using… May 11, 2026 at 7:40 pm

Related Questions

We are in the process of porting a legacy system to .NET, both to
With reference to this programming game I am currently building. alt text http://img12.imageshack.us/img12/2089/shapetransformationf.jpg To
I've got a Schroedinger's Cat type of problem here -- my program (actually the
Apologies for the long intro - just trying to suitably set the scene to

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.