473,664 Members | 3,035 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.Docu ment 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 3202
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.publi c.dotnet.langua ges.csharp and/or
microsoft.priva te.whidbey.csha rp.language. This group (.vc.language) is a
C++ group.

-cd
Jul 21 '05 #2
"rossum" <ro******@coldm ail.com> wrote in message
news:a1******** *************** *********@4ax.c om...
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 IOleCommandTarg et 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*****@hotmai l.com> wrote:
"rossum" <ro******@coldm ail.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 IOleCommandTarg et 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******@coldm ail.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.publi c.dotnet.langua ges.csharp I now have a solution:

webBrowser.Focu s();
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
3491
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 design mode with WebBrowser added on it I get such resolver error: Following Assembly Cannot be resolved: Interop.ShDocVw, Version=1.1.0.0, Culture=Neutral, PublicKeyToken=null
4
290
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 bar. What I want to do is to have a 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...
5
3111
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 >>> webbrowser.open("http://www.python.org") It does not throw an exception, but is not able to launch a browser.
12
6359
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 of course it's thrown up a whole host of new issues... I'm generating a multi page printable document in HTML from my app, and displaying it in a WebBrowser control. I've looked into using some CSS
0
1850
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 (MapInfo professional) from our app using interop services and do some reparenting etc to make it look like our app. We also register our own application as a COM server and let MapInfo professional register a callback so MapInfo can communicate...
6
10068
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 error message comes while trying to overwrite. runtime error -2147024864 The Process cannot access the file because it is being used by another
11
2208
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: //////////////////////////////////////////////// Public Sub DisplayHyperlinks(ByVal sender As Object, ByVal e As System.Windows.Forms.HtmlElementEventArgs)
11
3304
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: http://localhost:1226/Mr.%20Louis%20Jones/
3
9434
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 and when it receives a request it creates a new Form and adds a new WebBrowser. The problem - All works well without the WebBrowser, the form is visible, but when I do "Controls.Add(webBrowser)" I see nothing, not even something in the windows...
0
8348
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8861
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8778
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8549
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7375
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5660
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4185
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4351
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2003
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.