.NETGURU
Open Browse
Messages   Related Types
This message was discovered on microsoft.public.dotnet.languages.vb.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.
Post a new message to this list...

ruca
Hi,

Can anyone tell me if I can open a WebForm inside a WinForm? How? Give me
examples, please.

I have a winform application and I want that in some items opens a browser
inside.

Can you help?

--
Programming ASP.NET with VB.NET
Thank's (if you try to help me)
Hope this help you (if I try to help you)
ruca

Reply to this message...
 
    
Cor Ligthert
Ruca,

A little example,

Open a new windows application project
In the toolbox rightclick and select add/Remove items
In the customize toolbox select Com and in that Microsoft Webbrowser

When that is in the toolbox drag it to your form
Drag also a button to your form.

Then this code and you have a mini Webbrowser.

\\\
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Me.AxWebBrowser1.Navigate2("www.google.com")
End Sub
//
Some links
webbrowser
http://support.microsoft.com/?kbid=311303

some faqs
http://support.microsoft.com/default.aspx?scid=kb;EN-US;311284

mshtml
http://msdn.microsoft.com/library/default.asp?url=/workshop/browser/hosting/hosting.asp

I hope this helps a little bit?

Cor

Reply to this message...
 
    
ruca
In some pages I use Session variables. Can I pass values for that session
variables? How?

--
Programming ASP.NET with VB.NET
Thank's (if you try to help me)
Hope this help you (if I try to help you)
ruca

"Cor Ligthert" <Click here to reveal e-mail address> escreveu na mensagem
news:OH$w%Click here to reveal e-mail address...
[Original message clipped]

Reply to this message...
 
    
Cor Ligthert
Ruca,

The session variables are Server Side using a webform in a windowform is
Client Side.

Cor

[Original message clipped]

Reply to this message...
 
    
ruca
So..................

I can't do nothing about this?

--
Programming ASP.NET with VB.NET
Thank's (if you try to help me)
Hope this help you (if I try to help you)
ruca

"Cor Ligthert" <Click here to reveal e-mail address> escreveu na mensagem
news:Click here to reveal e-mail address...
[Original message clipped]

Reply to this message...
 
    
JD
Well you could hide the server side session variable in the html document,
then retrieve it by using the AxWebBrowser1.Document and the DOM.

"ruca" <Click here to reveal e-mail address> wrote in message
news:%Click here to reveal e-mail address...
[Original message clipped]

Reply to this message...
 
    
ruca
How can I do that?

"JD" <Click here to reveal e-mail address> escreveu na mensagem
news:%Click here to reveal e-mail address...
[Original message clipped]

Reply to this message...
 
    
JD
As an example....

In your body tag of your web page you could do:

<body MyVar=<%= Session("MyVar") %> >

Then your windows form do:

Private Sub Button1_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Button1.Click
Me.AxWebBrowser1.Navigate2("http://localhost/MySite/WebForm1.aspx";)
End Sub

Private Sub AxWebBrowser1_DocumentComplete(ByVal sender As Object, ByVal
e As AxSHDocVw.DWebBrowserEvents2_DocumentCompleteEvent) Handles
AxWebBrowser1.DocumentComplete
Dim S3 As String =
CType(AxWebBrowser1.Document.body.getAttribute("MyVar"), String)
End Sub

But you don't have to do just the body tag attribute, you could do this as
hidden input, xml tag, etc....

"ruca" <Click here to reveal e-mail address> wrote in message
news:Click here to reveal e-mail address...
[Original message clipped]

Reply to this message...
 
    
Cor Ligthert
Not that I know
"ruca"
> I can't do nothing about this?

Reply to this message...
 
    
Jeff Johnson [MVP: VB] (VIP)
"ruca" <Click here to reveal e-mail address> wrote in message
news:%Click here to reveal e-mail address...

[Original message clipped]

If you're looking to go beyond simply providing browser functionality to
your app and instead make it a sort of mini-ASP.NET then more than likely
your application would have to host the CLR like Web Matrix does. I doubt
this would be an easy solution.

Reply to this message...
 
    
Konrad Rotuski
look here :

http://lab.msdn.microsoft.com/express/vcsharp/develop/createwindowsapp/default.aspx
http://www.devhood.com/tutorials/tutorial_details.aspx?tutorial_id=312

HTH

Konrad

"ruca" <Click here to reveal e-mail address> wrote in message
news:%Click here to reveal e-mail address...
[Original message clipped]

Reply to this message...
 
 
System.EventArgs
System.Object




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification