Solved

Input from keybord in UpDownControl ?

Posted on 1998-10-21
2
171 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

As more and more people are shifting to the latest .Net frameworks, the windows presentation framework is gaining importance by the day. Many people are now turning to WPF controls to provide a rich user experience. I have been using WPF controls fo…
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…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

707 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