Solved

Input from keybord in UpDownControl ?

Posted on 1998-10-21
2
168 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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Run Program using VBScript 3 64
Windows Drag & Drop Location 2 100
Clicking on Print  property changes format of printing result 1 77
VS2015 Redefinition errors 4 49
This article describes how to programmatically preset the "Pages per Sheet" option that's available with most printer drivers.   This setting lets you do "n-Up" printing, where two, four, or more pages are printed on each sheet of paper. If your …
What my article will show is if you ever had to do processing to a listbox without being able to just select all the items in it. My software Visual Studio 2008 crystal report v11 My issue was I wanted to add crystal report to a form and show…
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…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

785 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