|
-
June 10th, 1999, 07:05 AM
#1
Dynamic Editbox
I have a button in my Dialogbox.
when user hits this button I am creating dinamic editbox under this Button.
My purpose is to close this Editbox when the user is hits enter in this Editbox.
please tell me some WORKIN' method of how can i make it with easy...
thanx alot
-
June 10th, 1999, 09:26 PM
#2
Re: Dynamic Editbox
I am not sure whether this gonna work.
But suggest U to set Ur edit ctrl to ES_WANTRETURN
by editctrl.ModifyStyle(0,ES_WANTRETURN) after normal edit ctrl
creation. And then override Pretranslate function
in Ur dialog as following
//assume that Ur edit ctrl variable is class global
BOOL CYourDlg::PreTranslateMessage(MSG* pMsg)
{
if (editctrl.IsWindowVisible())
{
if ( pMsg->hwnd == editctrl.GetSafeHwnd() && pMsg->message == WM_KEYDOWN)
{
if (pMsg->wParam == VK_RETURN)
{
editctrl.ShowWindow(SW_HIDE);
return TRUE;
}
}
return CDialog::PreTranslateMessage(pMsg);
}
Hop for help. 
Walter
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|