473,396 Members | 1,834 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,396 software developers and data experts.

PreProcessMessage

Hiya

Can anybody help me with the following?

I'm overriding PreProcessMessage on a DataGrid in order to capture keys.
However, the function is only called sometimes i.e. there doesn't seem to be
any pattern.

Can anybody help?

Geoff
Nov 21 '05 #1
6 2494
Hi Goeff!

What keys ?

--
Best Regards
Yanick
"Geoff Jones" <no********@email.com> a écrit dans le message de
news:41**********************@news.dial.pipex.com. ..
Hiya

Can anybody help me with the following?

I'm overriding PreProcessMessage on a DataGrid in order to capture keys.
However, the function is only called sometimes i.e. there doesn't seem to be any pattern.

Can anybody help?

Geoff

Nov 21 '05 #2
> What keys ?

for my own knowledge... shoudn't it be "which keys" or i can say both ?

--
Best Regards
Yanick

--
Best Regards
Yanick
"Geoff Jones" <no********@email.com> a écrit dans le message de
news:41**********************@news.dial.pipex.com. ..
Hiya

Can anybody help me with the following?

I'm overriding PreProcessMessage on a DataGrid in order to capture keys.
However, the function is only called sometimes i.e. there doesn't seem
to be
any pattern.

Can anybody help?

Geoff


Nov 21 '05 #3
Hi Zoury

Any really e.g. "A", "B", "Alt Z"

Geoff

"Zoury" <yanick_lefebvre at hotmail dot com> wrote in message
news:e3******************@TK2MSFTNGP10.phx.gbl...
What keys ?


for my own knowledge... shoudn't it be "which keys" or i can say both ?

--
Best Regards
Yanick

--
Best Regards
Yanick
"Geoff Jones" <no********@email.com> a écrit dans le message de
news:41**********************@news.dial.pipex.com. ..
> Hiya
>
> Can anybody help me with the following?
>
> I'm overriding PreProcessMessage on a DataGrid in order to capture
> keys.
> However, the function is only called sometimes i.e. there doesn't seem

to
be
> any pattern.
>
> Can anybody help?
>
> Geoff
>
>



Nov 21 '05 #4
ok then, try something like this :
http://groups.google.com/groups?selm...tngp13.phx.gbl

--
Best Regards
Yanick
"Geoff Jones" <no********@email.com> a écrit dans le message de
news:41**********************@news.dial.pipex.com. ..
Hi Zoury

Any really e.g. "A", "B", "Alt Z"

Geoff

"Zoury" <yanick_lefebvre at hotmail dot com> wrote in message
news:e3******************@TK2MSFTNGP10.phx.gbl...
What keys ?


for my own knowledge... shoudn't it be "which keys" or i can say both ?

--
Best Regards
Yanick

--
Best Regards
Yanick
"Geoff Jones" <no********@email.com> a écrit dans le message de
news:41**********************@news.dial.pipex.com. ..
> Hiya
>
> Can anybody help me with the following?
>
> I'm overriding PreProcessMessage on a DataGrid in order to capture
> keys.
> However, the function is only called sometimes i.e. there doesn't
seem to
be
> any pattern.
>
> Can anybody help?
>
> Geoff
>
>



Nov 21 '05 #5
oups there is something missing..

if you want to get notify for regular keys (A, b, 9, etc..) you can handle
WM_KEYDOWN too
'***
Public Class DataGridEx
Inherits DataGrid

Private Const WM_KEYDOWN As Int32 = &H100
Private Const WM_SYSKEYDOWN As Int32 = &H104
Private Const VK_DOWN As Int32 = &H28

Protected Overrides Function ProcessCmdKey(ByRef msg As
System.Windows.Forms.Message, ByVal keyData As System.Windows.Forms.Keys) As
Boolean

If (msg.Msg = WM_SYSKEYDOWN) Then
Console.WriteLine("WM_SYSKEYDOWN")
If (msg.WParam.ToInt32() = VK_DOWN) Then
Console.WriteLine("VK_DOWN")
If (Control.ModifierKeys = Keys.Alt) Then
Console.WriteLine("bingo!")
Return True
End If
End If
ElseIf (msg.Msg = WM_KEYDOWN) Then
Console.WriteLine("VK: {0}, Char: {1}", msg.WParam.ToInt32(),
CType(msg.WParam.ToInt32(), Keys).ToString())
End If

Return MyBase.ProcessCmdKey(msg, keyData)
End Function

End Class
'***

I'm not a hundred percent sure that a Virtual Key code (WParam) could be
convert into a Keys type though...

--
Best Regards
Yanick
"Zoury" <yanick_lefebvre at hotmail dot com> a écrit dans le message de
news:Ok****************@TK2MSFTNGP10.phx.gbl...
ok then, try something like this :
http://groups.google.com/groups?selm...tngp13.phx.gbl
--
Best Regards
Yanick
"Geoff Jones" <no********@email.com> a écrit dans le message de
news:41**********************@news.dial.pipex.com. ..
Hi Zoury

Any really e.g. "A", "B", "Alt Z"

Geoff

"Zoury" <yanick_lefebvre at hotmail dot com> wrote in message
news:e3******************@TK2MSFTNGP10.phx.gbl...
> What keys ?

for my own knowledge... shoudn't it be "which keys" or i can say both ?
--
Best Regards
Yanick
>
> --
> Best Regards
> Yanick
> "Geoff Jones" <no********@email.com> a écrit dans le message de
> news:41**********************@news.dial.pipex.com. ..
> > Hiya
> >
> > Can anybody help me with the following?
> >
> > I'm overriding PreProcessMessage on a DataGrid in order to capture
> > keys.
> > However, the function is only called sometimes i.e. there doesn't seem to
> be
> > any pattern.
> >
> > Can anybody help?
> >
> > Geoff
> >
> >
>
>



Nov 21 '05 #6
Thanks Zoury

"Zoury" <yanick_lefebvre at hotmail dot com> wrote in message
news:Or****************@TK2MSFTNGP10.phx.gbl...
oups there is something missing..

if you want to get notify for regular keys (A, b, 9, etc..) you can handle
WM_KEYDOWN too
'***
Public Class DataGridEx
Inherits DataGrid

Private Const WM_KEYDOWN As Int32 = &H100
Private Const WM_SYSKEYDOWN As Int32 = &H104
Private Const VK_DOWN As Int32 = &H28

Protected Overrides Function ProcessCmdKey(ByRef msg As
System.Windows.Forms.Message, ByVal keyData As System.Windows.Forms.Keys)
As
Boolean

If (msg.Msg = WM_SYSKEYDOWN) Then
Console.WriteLine("WM_SYSKEYDOWN")
If (msg.WParam.ToInt32() = VK_DOWN) Then
Console.WriteLine("VK_DOWN")
If (Control.ModifierKeys = Keys.Alt) Then
Console.WriteLine("bingo!")
Return True
End If
End If
ElseIf (msg.Msg = WM_KEYDOWN) Then
Console.WriteLine("VK: {0}, Char: {1}", msg.WParam.ToInt32(),
CType(msg.WParam.ToInt32(), Keys).ToString())
End If

Return MyBase.ProcessCmdKey(msg, keyData)
End Function

End Class
'***

I'm not a hundred percent sure that a Virtual Key code (WParam) could be
convert into a Keys type though...

--
Best Regards
Yanick
"Zoury" <yanick_lefebvre at hotmail dot com> a écrit dans le message de
news:Ok****************@TK2MSFTNGP10.phx.gbl...
ok then, try something like this :

http://groups.google.com/groups?selm...tngp13.phx.gbl

--
Best Regards
Yanick
"Geoff Jones" <no********@email.com> a écrit dans le message de
news:41**********************@news.dial.pipex.com. ..
> Hi Zoury
>
> Any really e.g. "A", "B", "Alt Z"
>
> Geoff
>
> "Zoury" <yanick_lefebvre at hotmail dot com> wrote in message
> news:e3******************@TK2MSFTNGP10.phx.gbl...
> >> What keys ?
> >
> > for my own knowledge... shoudn't it be "which keys" or i can say both ? > >
> > --
> > Best Regards
> > Yanick
> >>
> >> --
> >> Best Regards
> >> Yanick
> >> "Geoff Jones" <no********@email.com> a écrit dans le message de
> >> news:41**********************@news.dial.pipex.com. ..
> >> > Hiya
> >> >
> >> > Can anybody help me with the following?
> >> >
> >> > I'm overriding PreProcessMessage on a DataGrid in order to capture
> >> > keys.
> >> > However, the function is only called sometimes i.e. there doesn't

seem
> > to
> >> be
> >> > any pattern.
> >> >
> >> > Can anybody help?
> >> >
> >> > Geoff
> >> >
> >> >
> >>
> >>
> >
> >
>
>



Nov 21 '05 #7

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

Similar topics

0
by: Koert | last post by:
Hi, In the NumericUpDown control I have to detect that Tab was pressed so I have overroden the PreProcessMessage function. In for example the DateTimePicker this works fine but not in the...
0
by: sbdsolna | last post by:
Hi -- I've a inherited DataGrid and a public override PreProcessMessage The problem is that the method PreProcessMessage is not fired for the last row on the DataGrid. public class...
2
by: Benny Raymond | last post by:
I need to be able to process the message WM_MOVING and WM_MOVE, however I noticed that the following breakpoint in PreProcessMessage isn't hit on move (it does get hit when I press alt for instance...
1
by: mike | last post by:
I posted before and got the reply below, which really doesn't help me at all. I really didn't understand what the responder was talking about I'd like someone who is a microsoft expert to help...
0
by: Koert | last post by:
Hi In the NumericUpDown control I have to detect that Tab was pressed so I have inherited the NumericUpDown and overroden the PreProcessMessage function. In the DateTimePicker (for example) this...
3
by: Carmen de Lara | last post by:
hello to all, I found in Internet the following code that is very usefull to me. The code detects any character that is entered to datagrid, I am interested in the control key F2 but I don't know...
0
by: John Smith | last post by:
Hi All; I have implemented Syncfusion's suggested code sample to verify the deletion of DataGrid rows as follows: Public Overrides Function PreProcessMessage(ByRef msg As...
19
by: M. Posseth | last post by:
Hi ,, i live in Europe in Europe the decimal seperator is , not a . why is it so that if i press on my numeric keypad the . a . appears ?? in my opinion it should be a , ( sounds odd but...
10
by: Doug Bell | last post by:
Hi I am still having problems with Tabbing through a DataGrid with a DataGridComboBox Column. I need to allow the User to Type the value into the ComboBox so consequently its ComboBoxStyle is...
1
by: =?Utf-8?B?SnVzdCBjbG9zZSB5b3VyIGV5ZXMgYW5kIHNlZQ== | last post by:
Hi All i am trying to override the PreProcessMessage for the form and i am using this code public override bool PreProcessMessage(ref Message msg) { switch (msg.Msg) { case WM_RBUTTONDOWN:...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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,...

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.