Click here to Skip to main content
15,917,005 members
Home / Discussions / C#
   

C#

 
QuestionC# webbrowser control focus issues Pin
Wheels01217-Nov-09 9:06
Wheels01217-Nov-09 9:06 
AnswerRe: C# webbrowser control focus issues Pin
Shameel17-Nov-09 22:02
professionalShameel17-Nov-09 22:02 
GeneralRe: C# webbrowser control focus issues Pin
Wheels01218-Nov-09 1:40
Wheels01218-Nov-09 1:40 
GeneralRe: C# webbrowser control focus issues Pin
Shameel18-Nov-09 6:50
professionalShameel18-Nov-09 6:50 
GeneralRe: C# webbrowser control focus issues Pin
Wheels01218-Nov-09 7:01
Wheels01218-Nov-09 7:01 
GeneralRe: C# webbrowser control focus issues Pin
Shameel18-Nov-09 21:17
professionalShameel18-Nov-09 21:17 
GeneralRe: C# webbrowser control focus issues Pin
Wheels01220-Nov-09 1:32
Wheels01220-Nov-09 1:32 
GeneralRe: C# webbrowser control focus issues Pin
Shameel20-Nov-09 2:24
professionalShameel20-Nov-09 2:24 
I just created a small app to see myself what the problem is, and as you said, setting focus to the other control in DocumentCompleted event doesn't work. The reason I found is that DocumentCompleted is fired when the browser completes loading the html content of the page and google runs a javascript in its onload event to set focus to the search box. This happens after the DocumentCompleted event executes and therefore focus goes back to the control.

But ProgressChanged event works, and I found a workaround to do away with setting focus multiple times. Use this code:

C#
private void webBrowser1_ProgressChanged(object sender, WebBrowserProgressChangedEventArgs e) {
    if (e.CurrentProgress == e.MaximumProgress) {
        textBox1.Focus();
    }
}

GeneralRe: C# webbrowser control focus issues Pin
Wheels01220-Nov-09 2:33
Wheels01220-Nov-09 2:33 
Questionusing DirectorySearcher to get Group members Pin
caiena17-Nov-09 7:37
caiena17-Nov-09 7:37 
QuestionTCPListener/Many TCPClients -> Performance Issues? Pin
softwarejaeger17-Nov-09 6:04
softwarejaeger17-Nov-09 6:04 
AnswerRe: TCPListener/Many TCPClients -> Performance Issues? Pin
Paulo Zemek17-Nov-09 7:38
Paulo Zemek17-Nov-09 7:38 
GeneralRe: TCPListener/Many TCPClients -> Performance Issues? Pin
Matt Meyer17-Nov-09 10:06
Matt Meyer17-Nov-09 10:06 
GeneralRe: TCPListener/Many TCPClients -> Performance Issues? Pin
Paulo Zemek17-Nov-09 13:27
Paulo Zemek17-Nov-09 13:27 
GeneralRe: TCPListener/Many TCPClients -> Performance Issues? Pin
Matt Meyer18-Nov-09 4:43
Matt Meyer18-Nov-09 4:43 
GeneralRe: TCPListener/Many TCPClients -> Performance Issues? Pin
Paulo Zemek18-Nov-09 11:18
Paulo Zemek18-Nov-09 11:18 
GeneralRe: TCPListener/Many TCPClients -> Performance Issues? Pin
Matt Meyer18-Nov-09 11:33
Matt Meyer18-Nov-09 11:33 
Questionexport to excel in C# windows application Pin
FEMDEV17-Nov-09 4:01
FEMDEV17-Nov-09 4:01 
AnswerCross Post Pin
dan!sh 17-Nov-09 4:15
professional dan!sh 17-Nov-09 4:15 
Generalexcel Pin
FEMDEV17-Nov-09 4:17
FEMDEV17-Nov-09 4:17 
GeneralRe: Cross Post Pin
Abhishek Sur17-Nov-09 4:21
professionalAbhishek Sur17-Nov-09 4:21 
GeneralEXCEL Pin
FEMDEV17-Nov-09 4:22
FEMDEV17-Nov-09 4:22 
GeneralExcel Formatting Pin
FEMDEV20-Nov-09 4:17
FEMDEV20-Nov-09 4:17 
GeneralRe: Excel Formatting Pin
Abhishek Sur21-Nov-09 8:49
professionalAbhishek Sur21-Nov-09 8:49 
QuestionExecuteReader requires an open and available Connection. The connection's current state is closed. Pin
Vimalsoft(Pty) Ltd17-Nov-09 3:54
professionalVimalsoft(Pty) Ltd17-Nov-09 3:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.