473,626 Members | 3,152 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

open a new browser window in Windows Forms

VR
Hi,

How can I open a web site in a new browser window from a
regular windows form? (not an ASP.NET)

Do I have to use a COM ActiveX control or is there
anything like that already built in in .NET?

Thanks,
VR
Nov 15 '05 #1
5 60671
I ran across that problem awhile back and the microsoft knowledge base
didn't exactly help me:
http://support.microsoft.com/default...b;EN-US;305703

They suggest:

System.Diagnost ics.Process.Sta rt("http://www.google.com/index.html");

But that doesn't work for me (some kindof registry problem I guess).
This does work:
System.Diagnost ics.Process.Sta rt("z:\index.ht ml");

So my computer knows what to do with .html files, there's something
about it being on a drive vs. http that is screwing it up.

This will open a web page in a new window of internet explorer, as
long as IE is installed on the client.:
System.Diagnost ics.Process proc = new
System.Diagnost ics.Process();
proc.StartInfo. FileName = "iexplore";
proc.StartInfo. Arguments = "http://www.google.com/";
proc.Start();

I guess you can use either or both, depending upon what you expect the
client machines to look like.

HTH,
mike
"VR" <Vi************ ****@gat.com> wrote in message
news:07******** *************** *****@phx.gbl.. .
Hi,

How can I open a web site in a new browser window from a
regular windows form? (not an ASP.NET)

Do I have to use a COM ActiveX control or is there
anything like that already built in in .NET?

Thanks,
VR

Nov 15 '05 #2

Hi,

You can add the Microsoft Internet Control 1.1 reference to your
application, then you can use it like this:

SHDocVw.Interne tExplorerClass ie=new SHDocVw.Interne tExplorerClass ();
Object vHeaders = null;
Object vPost = null;
Object vTarget = null;
Object vFlags = null;
ie.Navigate("ht tp://www.google.com" ,ref vFlags,ref vTarget,ref vPost,ref
vHeaders);
ie.Visible =true;

Hope this helps.

Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
| Content-Class: urn:content-classes:message
| From: "VR" <Vi************ ****@gat.com>
| Sender: "VR" <Vi************ ****@gat.com>
| Subject: open a new browser window in Windows Forms
| Date: Wed, 6 Aug 2003 22:49:02 -0700
| Lines: 10
| Message-ID: <07************ *************** *@phx.gbl>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="iso-8859-1"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| Thread-Index: AcNcp5rf0BZ5eyx/RSa8lDKB5Azu0g= =
| Newsgroups: microsoft.publi c.dotnet.langua ges.csharp
| Path: cpmsftngxa06.ph x.gbl
| Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.langua ges.csharp:1747 68
| NNTP-Posting-Host: TK2MSFTNGXA13 10.40.1.165
| X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.csharp
|
| Hi,
|
| How can I open a web site in a new browser window from a
| regular windows form? (not an ASP.NET)
|
| Do I have to use a COM ActiveX control or is there
| anything like that already built in in .NET?
|
| Thanks,
| VR
|

Nov 15 '05 #3

Hi,

For more information, you can visit:
http://support.microsoft.com/default...;en-us;Q305703

Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
| Content-Class: urn:content-classes:message
| From: "VR" <Vi************ ****@gat.com>
| Sender: "VR" <Vi************ ****@gat.com>
| Subject: open a new browser window in Windows Forms
| Date: Wed, 6 Aug 2003 22:49:02 -0700
| Lines: 10
| Message-ID: <07************ *************** *@phx.gbl>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="iso-8859-1"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| Thread-Index: AcNcp5rf0BZ5eyx/RSa8lDKB5Azu0g= =
| Newsgroups: microsoft.publi c.dotnet.langua ges.csharp
| Path: cpmsftngxa06.ph x.gbl
| Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.langua ges.csharp:1747 68
| NNTP-Posting-Host: TK2MSFTNGXA13 10.40.1.165
| X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.csharp
|
| Hi,
|
| How can I open a web site in a new browser window from a
| regular windows form? (not an ASP.NET)
|
| Do I have to use a COM ActiveX control or is there
| anything like that already built in in .NET?
|
| Thanks,
| VR
|

Nov 15 '05 #4
VR
Thanks, Dmitriy.

-----Original Message-----
I ran across that problem awhile back and the microsoft knowledge basedidn't exactly help me:
http://support.microsoft.com/default.aspx?scid=kb;EN- US;305703
They suggest:

System.Diagnos tics.Process.St art ("http://www.google.com/index.html");
But that doesn't work for me (some kindof registry problem I guess).This does work:
System.Diagnost ics.Process.Sta rt ("z:\index.html ");
So my computer knows what to do with .html files, there's somethingabout it being on a drive vs. http that is screwing it up.

This will open a web page in a new window of internet explorer, aslong as IE is installed on the client.:
System.Diagnost ics.Process proc = new
System.Diagnos tics.Process();
proc.StartInfo. FileName = "iexplore";
proc.StartInfo. Arguments = "http://www.google.com/"; proc.Start();

I guess you can use either or both, depending upon what you expect theclient machines to look like.

HTH,
mike
"VR" <Vi************ ****@gat.com> wrote in message
news:07******* *************** ******@phx.gbl. ..
Hi,

How can I open a web site in a new browser window from a
regular windows form? (not an ASP.NET)

Do I have to use a COM ActiveX control or is there
anything like that already built in in .NET?

Thanks,
VR

.

Nov 15 '05 #5
VR
Thanks, Jeffrey.
-----Original Message-----

Hi,

For more information, you can visit:
http://support.microsoft.com/default.aspx?scid=kb;en- us;Q305703
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
--------------------
| Content-Class: urn:content-classes:message
| From: "VR" <Vi************ ****@gat.com>
| Sender: "VR" <Vi************ ****@gat.com>
| Subject: open a new browser window in Windows Forms
| Date: Wed, 6 Aug 2003 22:49:02 -0700
| Lines: 10
| Message-ID: <07************ *************** *@phx.gbl>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="iso-8859-1"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| Thread-Index: AcNcp5rf0BZ5eyx/RSa8lDKB5Azu0g= =
| Newsgroups: microsoft.publi c.dotnet.langua ges.csharp
| Path: cpmsftngxa06.ph x.gbl
| Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.langua ges.csharp:1747 68| NNTP-Posting-Host: TK2MSFTNGXA13 10.40.1.165
| X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.csharp
|
| Hi,
|
| How can I open a web site in a new browser window from a| regular windows form? (not an ASP.NET)
|
| Do I have to use a COM ActiveX control or is there
| anything like that already built in in .NET?
|
| Thanks,
| VR
|

.

Nov 15 '05 #6

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

Similar topics

10
2385
by: Simon Wigzell | last post by:
Is there any way to create and open a window in javascript so that links in other websites won't "steal" it? I've written a web page with a form for people to enter headlines and URLs from newspapers. They will want my window to stay there as they surf through various online newspapers. We don't want their popup links to take over my form window! This is a real problem - it renders my web page useless and wastes peoples time.
13
1861
by: Dave Holmes | last post by:
Is there a way to keep an other application from opening a link in a browser where I am running an ASP application? For example, I have an ASP application open in a browser. If I click on a link in an email message, Outlook "hijacks" the open browser and opens opens the link in it. Is there a way to prevent this? To somehow identifiy that browser window as "off limits" to another app? Thanks.
33
4060
by: randau | last post by:
Linking to a Targeted Browser Window I'd like to open reference links to other web sites in a separate browser window from the browser window hosting my own web site pages. The Link Target reserve word "_blank" opens a blank new browser window for every link, which can sometimes result in a lot of open browser windows. Is there no way to "reuse" a previously linked browser window and have it load the new web page in Foreground
6
2546
by: Ayende Rahien | last post by:
Excetremely annoying problem, I've an application with a long startup time. So I created another form with my logo in it to as a splash screen. The splash screen is run from another thread and is communicated solely through static method and Invoke()'s However, when I close my second form, the first one (main window) is hiding under all the windows on the desktop. If I don't close the splash screen, then everything is fine. I tried...
1
1782
by: vba man | last post by:
I've used the following code to open a browser window and read the data to a file. I know there is another way using a query, but that doesn't work for this application. What I'd like to be able to do is select a this open browser after opening other explorer windows. This would be similar to the command: Workbooks("objects.xls").Activate
2
1572
by: Pink | last post by:
Hi I am a Newbie to .Net can anyone let me know the diffrence between Windows.Forms and Winforms they are different version of totally different and are some methods different too Thanks
1
1459
by: jokolee | last post by:
I'm using web browser to view web page in vb form......I wanna read how much <div> is in the page ( it should be 3), but can't work it.....In javascript it's gonna be something like this....... (browser-object.contentDocument.documentElement.childNodes.item(1).childNodes).....I already using the ihtmldocument, but not working out... Example html page : <body> <div id="1">
19
2122
by: catmansa | last post by:
Is there anyway to determine the present pixel height & width size of a open browser window? :)
3
1524
Logan1337
by: Logan1337 | last post by:
Hi. I know about System.Diagnostics.Process.Start( url ) to launch a url in the default web browser, but I'm wondering if it's possible to actually get a path to the actual executable that is set as the default browser. In particular, I want to grab this file's icon to use in a menu item. Logan
0
8268
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8707
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...
1
8366
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
7199
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
5575
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
4093
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
4202
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1812
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1512
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.