473,398 Members | 2,525 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Cannot find WebBrowser.Find

I am using Visual C# Express Beta, though I suspect that my question
has more to do with .NET than with C# specifically. I have written a
form with a Web Browser in it. At the top I have a button bar. What
I want to do is to have a [Find] button which searches for
user-entered text in the HTML document in the Web Browser.

When I run my form I can type Ctrl-F and up comes a standard Find
dialogue box which does exactly what I want - the dialogue is
presumably built into the Web Browser as I certainly didn't put it
there. My problem is that I cannot find a way to trigger this Find
dialogue programatically so I can hook it into my [Find]. I have
looked through all the WebBrowser members and also through the
WebBrowser.Document members - no joy. Neither can I find a KeyPress
event attached to the WebBrowser so I could generate an internal
Ctrl-F to set things off.

If I have to I can code my own Find dialogue, but I would rather not
do this given that there is obviously one already built into the Web
Browser.

Does anyone have any thoughts as to ways to fire up the Web Browser's
Find dialogue programatically?

Thanks

rossum

--

The ultimate truth is that there is no Ultimate Truth
Jul 21 '05 #1
4 3174
rossum wrote:
I am using Visual C# Express Beta, though I suspect that my question
has more to do with .NET than with C# specifically.


You should post to microsoft.public.dotnet.languages.csharp and/or
microsoft.private.whidbey.csharp.language. This group (.vc.language) is a
C++ group.

-cd
Jul 21 '05 #2
"rossum" <ro******@coldmail.com> wrote in message
news:a1********************************@4ax.com...
Does anyone have any thoughts as to ways to fire up the Web Browser's
Find dialogue programatically?


In the HtmlEditor (http://www.itwriting.com/htmleditor/index.php) I do this
by casting the HTMLDocument to IOleCommandTarget and then calling exec with
IDM_FIND for the argument. This should work for the WebBrowser control too;
you could take a look at the code. Maybe there's an easier way, I'm not
sure.

Tim
How much memory does my .NET application use?
http://www.itwriting.com/dotnetmem.php

Jul 21 '05 #3
On Thu, 10 Mar 2005 20:17:04 -0000, "Tim Anderson"
<ti*****@hotmail.com> wrote:
"rossum" <ro******@coldmail.com> wrote in message
news:a1********************************@4ax.com.. .
Does anyone have any thoughts as to ways to fire up the Web Browser's
Find dialogue programatically?


In the HtmlEditor (http://www.itwriting.com/htmleditor/index.php) I do this
by casting the HTMLDocument to IOleCommandTarget and then calling exec with
IDM_FIND for the argument. This should work for the WebBrowser control too;
you could take a look at the code. Maybe there's an easier way, I'm not
sure.

Tim
How much memory does my .NET application use?
http://www.itwriting.com/dotnetmem.php

Thanks Tim and Carl for the suggestions.

rossum
--

The ultimate truth is that there is no Ultimate Truth
Jul 21 '05 #4
On Wed, 09 Mar 2005 23:38:24 +0000, rossum <ro******@coldmail.com>
wrote:

[snip question]
Does anyone have any thoughts as to ways to fire up the Web Browser's
Find dialogue programatically?

Thanks

rossum


Thanks to Alexander Shirsov on
microsoft.public.dotnet.languages.csharp I now have a solution:

webBrowser.Focus();
SendKeys.Send("^f");

That is in C#. I presume that the C++ solution will be similar to:

webBrowser->Focus();
SendKeys->Send("^f");

(Warning: C++ code not tested.)

rossum

--

The ultimate truth is that there is no Ultimate Truth
Jul 21 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Orantas Gladkauskas | last post by:
Hello everybody, I'm using Visual Studio 2003. Everything was fine until yesterday. I cannot add a WebBrowser or any other COM component on windows form any more. Every time I open a form in...
4
by: rossum | last post by:
I am using Visual C# Express Beta, though I suspect that my question has more to do with .NET than with C# specifically. I have written a form with a Web Browser in it. At the top I have a button...
5
by: SPE - Stani's Python Editor | last post by:
Hi, During optimizing SPE for Ubuntu, I found something strange. I have Ubuntu 5.10 "The Breezy Badger" and unfortunately this code is not working: >>> import webbrowser >>>...
12
by: Alex Clark | last post by:
Greetings, (.NET 2.0, WinXP Pro/Server 2003, IE6 with latest service packs). I've decided to take advantage of the layout characteristics of HTML documents to simplify my printing tasks, but...
0
by: jan.loucka | last post by:
We're running Windows Forms application written in .NET 2.0 (c#). The application is single threaded app - it starts without any form (Application.run()). After that we start another application...
6
by: None | last post by:
Hi, I have an application which displays a PDF file on webbrowser control in Visual Basic. On click of a button this PDF is re-generated and overwritten. As the PDF is already open following...
11
by: kimiraikkonen | last post by:
Hi there, I needed to use MouseOver event on Webbrowser which is NOT provided by webbrowser control natively(what a disappointment), so i decided to go with another route to simulate this like: ...
11
by: AAaron123 | last post by:
I have an vs2008 app that generates a website. I have a vs2008 app that uses the webbrowser and does this: WebBrowser1.Navigate(New Uri(address)) the address is: ...
3
by: TedTrippin | last post by:
Hi, Background - I've create a windows application in VS and added a WebBrowser component and all works well. I'm now trying to do this programmatically. My application now listens on a socket...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.