473,398 Members | 2,125 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Can not catch KeyDown message from RETURN key

Hi all,

I got a problem with Return key in my C++/C# application.
On CView dilalog I put my C# control. This C# control has couple
other controls nested. I have problem with RichTextBox control which
is at the bottom of my control hierarchy. It does not process
VK_RETURN key down. So I can not create new line. All other keys work
in RichTextBox. Of course I made it Multiline. I used Spy++ tool to
figure out what is going on. I managed to see that RichTextBox window
receives RETURN message. But nothing happens.
My OnKeyDown handler is hit for all keys except of RETURN.

I would greatly appreciate any hints.

Thanks in advance,
Roman
Nov 16 '05 #1
3 7555
Roman,

Can you provide a sample in the zip file, demonstrating your problem?. I
will investigate on that and hopefully it can be fixed.

--
Shak
(Houston)
"Roman Muntyanu" <mu******@hotmail.com> wrote in message
news:df**************************@posting.google.c om...
Hi all,

I got a problem with Return key in my C++/C# application.
On CView dilalog I put my C# control. This C# control has couple
other controls nested. I have problem with RichTextBox control which
is at the bottom of my control hierarchy. It does not process
VK_RETURN key down. So I can not create new line. All other keys work
in RichTextBox. Of course I made it Multiline. I used Spy++ tool to
figure out what is going on. I managed to see that RichTextBox window
receives RETURN message. But nothing happens.
My OnKeyDown handler is hit for all keys except of RETURN.

I would greatly appreciate any hints.

Thanks in advance,
Roman

Nov 16 '05 #2
send it to sh***********@yahoo.com .Make ur zip file small size if its
possible

--
Shak
(Houston)


"Roman Muntyanu" <mu******@hotmail.com> wrote in message
news:df**************************@posting.google.c om...
Hi Shak,

I tried to send zip file with my testing project to sh**@fakedomain.com
but delivery failed. Is this possible to post file in this thread?
Or mayby I can send to another your address.

I appreciate your time.

Thanks, Roman

"Shakir Hussain" <sh**@fakedomain.com> wrote in message

news:<Ou**************@tk2msftngp13.phx.gbl>...
Roman,

Can you provide a sample in the zip file, demonstrating your problem?. I
will investigate on that and hopefully it can be fixed.

--
Shak
(Houston)
"Roman Muntyanu" <mu******@hotmail.com> wrote in message
news:df**************************@posting.google.c om...
Hi all,

I got a problem with Return key in my C++/C# application.
On CView dilalog I put my C# control. This C# control has couple
other controls nested. I have problem with RichTextBox control which
is at the bottom of my control hierarchy. It does not process
VK_RETURN key down. So I can not create new line. All other keys work
in RichTextBox. Of course I made it Multiline. I used Spy++ tool to
figure out what is going on. I managed to see that RichTextBox window
receives RETURN message. But nothing happens.
My OnKeyDown handler is hit for all keys except of RETURN.

I would greatly appreciate any hints.

Thanks in advance,
Roman

Nov 16 '05 #3
Roman.,

We both had good email communication, and finally got the solution for your
problem. I am posting the answer for others to benefit

To In the derived class of RichEditBox,

protected override void WndProc(ref Message m)
{
int WM_GETDLGCODE = 0x0087;
int VK_RETURN = 0x0D;
if (m.Msg == WM_GETDLGCODE)
{
if (m.WParam.ToInt32() == VK_RETURN)
{
base.SelectedText = "\n";
return ;
}
}
base.WndProc (ref m);
}
--
Shak
(Houston)
"Roman Muntyanu" <mu******@hotmail.com> wrote in message
news:df**************************@posting.google.c om...
Hi Shak,

I tried to send zip file with my testing project to sh**@fakedomain.com
but delivery failed. Is this possible to post file in this thread?
Or mayby I can send to another your address.

I appreciate your time.

Thanks, Roman

"Shakir Hussain" <sh**@fakedomain.com> wrote in message

news:<Ou**************@tk2msftngp13.phx.gbl>...
Roman,

Can you provide a sample in the zip file, demonstrating your problem?. I
will investigate on that and hopefully it can be fixed.

--
Shak
(Houston)
"Roman Muntyanu" <mu******@hotmail.com> wrote in message
news:df**************************@posting.google.c om...
Hi all,

I got a problem with Return key in my C++/C# application.
On CView dilalog I put my C# control. This C# control has couple
other controls nested. I have problem with RichTextBox control which
is at the bottom of my control hierarchy. It does not process
VK_RETURN key down. So I can not create new line. All other keys work
in RichTextBox. Of course I made it Multiline. I used Spy++ tool to
figure out what is going on. I managed to see that RichTextBox window
receives RETURN message. But nothing happens.
My OnKeyDown handler is hit for all keys except of RETURN.

I would greatly appreciate any hints.

Thanks in advance,
Roman

Nov 16 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Gene Hubert | last post by:
I'm trying to catch the KeyUp event in textbox of a DataGrid. I'm picking up the keydown and keypress events ok, but not keyup. Can anyone see what is wrong with this code. I been fighting with...
5
by: Lars Netzel | last post by:
Hey! I have tried...(in a datagrid) e.KeyDate.Return and e.KeyDate.TAB end e.KeyDate.Enter
2
by: John Huang | last post by:
I would like to use datagrid's keydown event to capture the "Ctrl+D" when users press this key. But it did not work. What did I miss? (I have already set the form keypreview to true) Private...
0
by: tony | last post by:
Hello!! I have a derived class called StringClassEditor which inherit from UITypeEditor listed below. Now to my question in method EditValue in this class I have this statement lb.KeyDown ...
2
by: sytemper | last post by:
I write a keydown KeyDown event to catch if tab is press or tab+shift is press.And i already override the IsInputKey method. But noe i only can get the tab but no shift+tab. When shift+tab is...
3
by: MLM450 | last post by:
I have a control that handles the KeyDown event but it does not seem to execute when a combination of keys is pressed - like CTRL+Z. If I press CTRL, it executes. If I press Z, it executes. But the...
1
by: kgerritsen | last post by:
I am building an application that will receive input from a barcode scanner. The barcode scanner is configured to append to the front value a single character and hyphen that identify the barcode...
2
by: Tony Johansson | last post by:
Hello! I have created a Control that consist of a label and a textbox.I have called this class ctlLabelTextbox. public partial class ctlLabelTextbox : UserControl { .... } The class that I...
4
by: Tom P. | last post by:
You wouldn't think this would be as hard as it is but for some reason I can't find a way to translate any of the codes in the KeyDownEventArgs into the actual characters they represent. The best...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.