Click here to Skip to main content
15,897,273 members
Home / Discussions / C#
   

C#

 
AnswerRe: delete record from Datagrid view which check box are checked Pin
Manoj Kumar Rai20-May-07 21:45
professionalManoj Kumar Rai20-May-07 21:45 
QuestionRegular Expression Match Grouping Pin
nasambur20-May-07 19:56
nasambur20-May-07 19:56 
QuestionDAAB- SQLHelper ExecuteDataSet vs Fill Method Pin
K.P.Kannan20-May-07 18:29
K.P.Kannan20-May-07 18:29 
AnswerRe: DAAB- SQLHelper ExecuteDataSet vs Fill Method Pin
Tarakeshwar Reddy22-May-07 2:55
professionalTarakeshwar Reddy22-May-07 2:55 
QuestionNavigate the web Pin
brsecu20-May-07 16:26
brsecu20-May-07 16:26 
AnswerRe: Navigate the web Pin
blackjack215020-May-07 19:10
blackjack215020-May-07 19:10 
GeneralRe: Navigate the web Pin
brsecu21-May-07 1:15
brsecu21-May-07 1:15 
GeneralRe: Navigate the web Pin
blackjack215021-May-07 21:34
blackjack215021-May-07 21:34 
Ok, here it is.
I hope it's not too late. I was quite busy yesterday afternoon and I didn't have time to check the codeproject forum.

So, a simple example of how to do an automatic search on google:

Place a WebBrowser control on your form.
Use it's navigate method to load the google page:

MyWebBrowser.Navigate("http://www.google.com");

In order to access the controls on the webpage and use them, you need to know what their names are from the html source of the page. If you take a look at google's source you'll see all the controls, and among them these two:



and



The first one is the text box where you type the text to search and the second is the search button.

So, all you need to do is fill the text box and after that simulate clicking the "Google Search" button. Like this:


HtmlElement searchBox = MyWebBrowser.Document.All["q"];
searchBox.InnerText = "code project";
HtmlElement btnSearch = MyWebBrowser.Document.All["btnG"];
btnSearch.InvokeMember("click");

Hope this helps.

Have a nice day!

PS: There's a very quick and easy way to find the name of the controls you need from a web page. It's called Firebug. It's a plug-in for Firefox. Just use it. I'm sure you'll find it great, too.
GeneralRe: Navigate the web Pin
brsecu22-May-07 10:52
brsecu22-May-07 10:52 
GeneralRe: Navigate the web Pin
blackjack215022-May-07 11:31
blackjack215022-May-07 11:31 
GeneralRe: Navigate the web Pin
Little_Dice27-May-07 21:46
Little_Dice27-May-07 21:46 
GeneralRe: Navigate the web Pin
blackjack215027-May-07 22:34
blackjack215027-May-07 22:34 
GeneralRe: Navigate the web [modified] Pin
Little_Dice28-May-07 11:32
Little_Dice28-May-07 11:32 
GeneralRe: Navigate the web Pin
blackjack215028-May-07 22:16
blackjack215028-May-07 22:16 
GeneralRe: Navigate the web Pin
Little_Dice29-May-07 9:26
Little_Dice29-May-07 9:26 
QuestionOffice 11 and Interop. Pin
swjam20-May-07 16:23
swjam20-May-07 16:23 
QuestionCreate and print PDF file in web application using iTextSharp assembly Pin
There is always the way to do it, but I don't know20-May-07 13:44
There is always the way to do it, but I don't know20-May-07 13:44 
AnswerRe: Create and print PDF file in web application using iTextSharp assembly Pin
blackjack215020-May-07 20:20
blackjack215020-May-07 20:20 
GeneralRe: Create and print PDF file in web application using iTextSharp assembly Pin
There is always the way to do it, but I don't know21-May-07 11:00
There is always the way to do it, but I don't know21-May-07 11:00 
GeneralRe: Create and print PDF file in web application using iTextSharp assembly Pin
There is always the way to do it, but I don't know22-May-07 7:57
There is always the way to do it, but I don't know22-May-07 7:57 
QuestionHow to set the caret position in ComboBox? Pin
GaryShen20-May-07 12:54
GaryShen20-May-07 12:54 
QuestionHelp! I'm going insane!!!! Pin
mfkr20-May-07 12:48
mfkr20-May-07 12:48 
AnswerRe: Help! I'm going insane!!!! Pin
Christian Graus20-May-07 12:52
protectorChristian Graus20-May-07 12:52 
GeneralRe: Help! I'm going insane!!!! Pin
mfkr20-May-07 13:16
mfkr20-May-07 13:16 
GeneralRe: Help! I'm going insane!!!! Pin
Christian Graus20-May-07 13:19
protectorChristian Graus20-May-07 13:19 

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.