AxSHDocVw.AxWebBrowser axWebBrowser1; I am making a web editor(wysiwyg editor). My program has a toolStrip and axWebBrowser control When I want to change the font of the webbrowser, select my comboBox on toolStrip, it make the font change but the FOCUS Remain in Font ComboBox. I want give the focus to axWebBrowser programmically. here is the code that executed when the ComboBox SelectedIndex changed
case 32:
doc1.execCommand("FontSize", false, (object) ((ToolStripComboBox)sender).SelectedItem.ToString().Split('(',')')[1]); //change font it works fine.
//but next to give focus to axWebBrowser is not working.
Win32.SetForegroundWindow(axWebBrowser1.Handle); //don't work
Win32.SetFocus(new System.Runtime.InteropServices.HandleRef(null, axWebBrowser1.Handle)); //don't work
//mshtml.IHTMLTxtRange txt = (mshtml.IHTMLTxtRange)doc1.selection.createRange();
//txt.select(); //tried but...
//axWebBrowser1.Update();
//axWebBrowser1.Select(); //tried but...
//tabPage1.SelectNextControl(axWebBrowser1, true, true, true, true); //tried but...
//axWebBrowser1.Select(); //it is not working...
please take care of my question. thanks a lot.