Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
N

NickB

@NickB
About
Posts
1
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • WebBrowser hosted in a WPF user control called from MFC dialog hangs when pressing the TAB key.
    N NickB

    I feel for you.... MFC and WPF don't play well when it comes to the keyboard. The best solution is to not mix controls! That said, other things you'll need to do to get tabbing kinda working: 1. Override pretranslate message in you App: BOOL CMyApp::PreTranslateMessage(MSG* pMsg) { if (System::Windows::Interop::ComponentDispatcher::RaiseThreadMessage(*reinterpret_castSystem::Windows::Interop::MSG\*(pMsg))) return true; else return CWinApp::PreTranslateMessage(pMsg); } 2. Implement IKeyboardInfoSite and handle OnNoMoreTabStops. Call the MFC dialogs NextDlgCtrl method and return true: In OnCreate: ((IKeyboardInputSink^) hwndWPF)->KeyboardInputSite = gcnew MyKeyboardInputSite(source); bool GKeyboardInputSite::OnNoMoreTabStops(TraversalRequest^ request) { if (request->FocusNavigationDirection == FocusNavigationDirection::Next) wpfDialog->NextDlgCtrl(); else wpfDialog->PrevDlgCtrl(); return true; } The only problem with this is that tabbing back into the WPF user control puts the focus on the last control (not the first). Yet to figure out the best way to overcome that one. Hope this helps

    WPF csharp wpf com help c++
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups