Solved

Input from keybord in UpDownControl ?

Posted on 1998-10-21
2
162 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
Comment Utility
I increased to 100 points.

Is that enough for you "experts" ?


0
 
LVL 14

Accepted Solution

by:
AlexVirochovsky earned 100 total points
Comment Utility
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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

This tutorial is about how to put some of your C++ program's functionality into a standard DLL, and how to make working with the EXE and the DLL simple and seamless.   We'll be using Microsoft Visual Studio 2008 and we will cut out the noise; that i…
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.  …
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…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

762 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

15 Experts available now in Live!

Get 1:1 Help Now