471,325 Members | 1,447 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

Problems trapping key events using WndProc in a Control Designer

Ron
I'm having trouble capturing key events in my Custom Designer using WndProc:
(in Design mode)

What am I missing??
Thanks,
Ron

private const int WM_MOUSEMOVE = 0x0200;
private const int WM_LBUTTONDOWN = 0x0201;
private const int WM_LBUTTONUP = 0x0202;
private const int WM_LBUTTONDBLCLK = 0x0203;
private const int WM_RBUTTONDOWN = 0x0204;
private const int WM_RBUTTONUP = 0x0205;
private const int WM_RBUTTONDBLCLK = 0x0206;
private const int WM_KEYDOWN = 0x0100;
protected const int VK_LEFT = 0x0025;
protected const int VK_UP = 0x0026;
protected const int VK_RIGHT = 0x0027;
protected const int VK_DOWN = 0x0028;

protected override void WndProc(ref Message m)
{
Point p;
Rectangle rLeft;
Rectangle rRight;
apx_UltraTextBox dl = (apx_UltraTextBox)(this.Control);
switch (m.Msg)
{
case WM_KEYDOWN:
<---------------This never gets called
MessageBox.Show(m.Msg.ToString());
break;

case WM_LBUTTONDOWN: <--------------
This works
rLeft = calcAdornmentRectLeft();
rRight = calcAdornmentRectRight();
p = new Point(m.LParam.ToInt32());
if (rLeft.Contains(p))
{
draggingLeft = true;
this.Control.Parent.Cursor = Cursors.SizeWE;
}
else if (rRight.Contains(p))
{
draggingRight = true;
this.Control.Parent.Cursor = Cursors.SizeWE;
}

//base.WndProc(ref m);

break;
........

Jun 27 '08 #1
0 909

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Kevin | last post: by
17 posts views Thread by Lloyd Sheen | last post: by
3 posts views Thread by Michael Tissington | last post: by
reply views Thread by BigAl.NZ | last post: by
19 posts views Thread by zacks | last post: by
reply views Thread by rosydwin | last post: by

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.