Edit-derived OCX want arrows from VB4
Frederic Steppe -- frederic.steppe@infoboard.be Wednesday, November 06, 1996 Environment: VC++ 4.2b, Win 95, VB4 Hi, I'm trying to write an edit-derived OCX control using MFC. Everything works fine so far, except I can't get left and right arrows messages when embedded in a VB4 form. The arrows make the focus move to the previous or next field (like Tab/Sh-Tab). From the OLE control test container, it's OK. I tried to implement a WM_GETDLGCODE in the control's class, it is never called. I never get any WM_KEYDOWN nor WM_CHAR for those keys, but when Shift is pressed, the edit works normally. I suspect there must be some way to tell VB that I want the arrows, but I didn't find any. Frederic Steppe frederic.steppe@infoboard.be
Michael Schneider -- Michael.Schneider@datev.de Friday, November 08, 1996 Hi Frederic, > > I suspect there must be some way to tell VB that I want the arrows, but I > didn't find any. > Yes there is. I've got the same problem and the only solution I found was to overload PreTranslateMessage. You check for WM_KEYDOWN and WM_KEYUP there. If one of the four arrow keys is pressed, you don't pass the message to the base class, but dispatch it by your own. Regards, Michael --------------------------------------------------- Michael Schneider Pirckheimer Weg 13 91058 Erlangen Tel.: ++49 9131 771539 E-Mail: Mike.Schneider@fim.uni-erlangen.de oder: Mike.Schneider@t-online.de WWW: http://home.t-online.de/home/Mike.Schneider ---------------------------------------------------
| Вернуться в корень Архива |