CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: problem with CEdit in CDialogBar

  1. #1
    Join Date
    Jul 2001
    Posts
    306

    problem with CEdit in CDialogBar

    Hello,

    please help me with a special behaviour of a CEdit-control in a CDialogBar:
    My CDialogBar is a member of my MDI-mainframe-class. The menu of the mainframe have an item with an accelerator "r".
    Now, if I want to type the letter "r" in my CEdit-control, the menu-item (with the accelerator "r") will be called.

    How can I type "r" into the CEdit-control?
    How can I handle it?

    thx.
    Ralf

  2. #2
    Join Date
    Jul 2001
    Posts
    306

    Re: problem with CEdit in CDialogBar

    Hello,

    because no one had an idea, I tried some things I came to this solution:
    overwrite the function PreTranslateMessage in CWinApp.
    Code:
    BOOL CMyApp::PreTranslateMessage(MSG* pMsg)
    {
            // CEdit window
    	CWnd* w=((CMainFrame*)m_pMainWnd)->m_GleisBar.GetDlgItem(IDC_NUMMER);
    	if(pMsg->hwnd==w->m_hWnd)
    	{
    		if(pMsg->message==WM_KEYDOWN)
    		{
    			::TranslateMessage(pMsg);
    			return TRUE;
    		}
    	}
    	return CWinApp::PreTranslateMessage(pMsg);
    }
    Any comments to this solution?

    Ralf

  3. #3
    Join Date
    May 1999
    Location
    DELAWARE, USA
    Posts
    9,917

    Re: problem with CEdit in CDialogBar

    It not edit control problem, it is a problem with creation of the accelerator.
    You should use modifier: Ctrl, Alt or both when creating accelerator.
    There are only 10 types of people in the world:
    Those who understand binary and those who do not.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)