Keyboard Focus issue with Hybrid Application WPF->WinForms->ActiveX/VB6OCX

  • Thread starter Thread starter VikasMittal
  • Start date Start date
V

VikasMittal

Guest
I have a WPF application with a tab control, each tab contains a winformhost control that in turns host VB6 OCX controls.

WinForms User control is hosting VB6 OCX, using AxHost

I am having problem setting the keyboard focus to VB6 OCX, VB6 ocx has textbox, checkbox.. User clicks on a checkbox and now it has the focus, user then clicks on a different tab and now ocx loses focus, I want to set the focus back to same text box when user switches back to that tab.

I am able to make it work by simulating Tab key down, When user clicks on the tab the tab has the focus and if i tab then the text box gets the focus, but that does not always work and also raise key click event and i have to put extra logic to ignore this event.

AxHost has a focus method and i used it but it does not set the focus to VB6 Ocx.

Is there a way to programatically set the focus to VB6 OCX.

thanks

vikas

Continue reading...
 
Back
Top