Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Input from keybord in UpDownControl ?

Posted on 1998-10-21
2
Medium Priority
?
173 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 200 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

Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

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…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
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…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

609 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