Board index » cppbuilder » BCB6: Cannot type hyphen in TEdit, TMemo controls

BCB6: Cannot type hyphen in TEdit, TMemo controls


2008-02-28 05:38:04 AM
cppbuilder92
I have a new project where multiple forms inherit from a base form. I am
unable, at runtime, to enter a hyphen from the main, QWERTY portion of
the keyboard into a TEdit or TMemo control.
I see that others have encountered this over the years, but I could not
find a clear explanation. It seems to have something to do with
TForm.KeyPreview, OnKeyDown and/or OnKeyPress.
I am using BCB6, Build 10.166. Running on WinXP/SP2. Connected to MS SQL
Server 2000 database.
I have written countless applications with BCB6 and have never
encountered this situation before.
Thank you for any light you can shed on this problem.
Kathleen
 
 

Re:BCB6: Cannot type hyphen in TEdit, TMemo controls

I decided to post the solution to this problem (programmer stupidity) in
case anybody else ever makes this same mistake. Or in case I make the
mistake again and can't remember how I solved it (I always run to Google
groups first).
In one of the forms in my inheritance hierarchy, I added some items to a
merge-able menu. Among the items was a delimiter, created with caption
"-". Evidently I had the focus on the Shortcut property of the menu item
when I was setting it up, and didn't notice that I typed "-" into the
shortcut. The result: Typing a hyphen on any descendant forms would
"trigger" this no-event menu item.
Kathleen
Kathleen wrote:
Quote
I have a new project where multiple forms inherit from a base form. I am
unable, at runtime, to enter a hyphen from the main, QWERTY portion of
the keyboard into a TEdit or TMemo control.

I see that others have encountered this over the years, but I could not
find a clear explanation. It seems to have something to do with
TForm.KeyPreview, OnKeyDown and/or OnKeyPress.

I am using BCB6, Build 10.166. Running on WinXP/SP2. Connected to MS SQL
Server 2000 database.

I have written countless applications with BCB6 and have never
encountered this situation before.

Thank you for any light you can shed on this problem.

Kathleen