Solved

Input from keybord in UpDownControl ?

Posted on 1998-10-21
2
167 Views
Last Modified: 2013-12-03
How do i do to take input to my UpDownControl, from the keybord?

My Edit window has the style: WS_CHILD |  WS_BORDER | WS_VISIBLE |  ES_NUMBER | ES_CENTER.

And my UD-control: WS_CHILD | WS_VISIBLE | UDS_SETBUDDYINT | UDS_ARROWKEYS | UDS_WRAP | UDS_ALIGNRIGHT
0
Comment
Question by:AndersCarlsson
2 Comments
 

Author Comment

by:AndersCarlsson
ID: 1415501
I increased to 100 points.

Is that enough for you "experts" ?


0
 
LVL 14

Accepted Solution

by:
AlexVirochovsky earned 100 total points
ID: 1415502
There is standart metod for capture messages for
all types of Contols. I descrybe it for ListBox, you can easy use
it for Edit, UP_Control, ...

1. Define new Class MyListBox: in file mylistbo.h
#if !defined(__MYLISTBOX)
#define __MYLISTBOX
class MyListBox: public TListBox{    
public:
  MyListBox(TWindow* parent,int nResId);
  void EvChar(UINT key, UINT repeatCount, UINT flags);

  void EvKeyUp(UINT key, UINT repeatCount, UINT flags);

  TWindow* tParent;
DECLARE_RESPONSE_TABLE(MyListBox);
};
#endif
2. In cpp Programm:
#include "mylistbo.h"
DEFINE_RESPONSE_TABLE1(MyListBox, TListBox)
   EV_WM_CHAR,
   EV_WM_KEYUP,
END_RESPONSE_TABLE;
MyListBox::MyListBox(TWindow* parent,int nResId)
  : TListBox(parent, nResId)
{
  tParent = parent;
}
void MyListBox::EvKeyUp(UINT key, UINT /*repeatCount*/, UINT /*flags*/)
{
...
In this place must insert you code
}

void MyListBox::EvChar(UINT key, UINT /*repeatCount*/, UINT /*flags*/)
{
 .......
In this place must insert you code
}
 
In you Dialog Procedure you must type something as:
MyListBox *tMy = new MyListBox(IDC_LISTBOX,..);
This example for OWL, but you easy make it in MFC, or
standart C++.
 
  "expert"
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows a few slightly more advanced techniques for Windows 7 gadget programming, including how to save and restore user settings for your gadget and how to populate the "details" panel that is displayed in the Windows 7 gadget gallery.  …
With most software applications trying to cater to multiple user needs nowadays, the focus is to make them as configurable as possible. For e.g., when creating Silverlight applications which will connect to WCF services, the service end point usuall…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now