Accessing IE from usercontrol

  • Thread starter Thread starter Febronio
  • Start date Start date
F

Febronio

Can someone tell me how to access the Internet Explorer
Document from a vb.net usercontrol hosted in this
document ?
Me.parent, parentform, findform don't seem to work.

Thanks
..
 
Febricio,

Your question is for me not clear, however it can be this one.

As sample

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

I hope I gambled right,

Cor
 
Febronio said:
Can someone tell me how to access the Internet Explorer
Document from a vb.net usercontrol hosted in this
document ?
Me.parent, parentform, findform don't seem to work.

I am not sure if this is possible at all. If you don't get an answer here,
give microsoft.public.dotnet.framework.windowsforms[.controls] a try.
 
Thanks Cor,

Sorry I wasn't clear enough.
Am working on an vb activex hosted in a HTA or MSIE document like this :
<object id="imagecontrole" height="600" width="800"

classid="http:imagecontrole.dll#imgctrl.imagectrl" VIEWASTEXT>

</object>

What I need to do is to access to the document that is actually hosting the
activex.
I've been working on that probleme for a week. The document I try to reach
is the
container of the activeX, not an activeX contained in my vb control.
That's why I tried me.parent, me.findform, or containercontrol that work
fine with
VS control testcontainer but return Nothing with MSIE.

I can't believe that it's not so obvious ! :D


P.
 
Patrice,

Still you are in my opinion not clear enough, however trying that little
sample I showed in my message can open a new world for you to the route to
get your answer.

What do you want, run that active X?
Get that active X?
Get that active X and use it in your program?

Cor
 
Herfried,
Can someone tell me how to access the Internet Explorer
Document from a vb.net usercontrol hosted in this
document ?
Me.parent, parentform, findform don't seem to work.

I am not sure if this is possible at all. If you don't get an answer
here, give microsoft.public.dotnet.framework.windowsforms[.controls] a
try.

I don't see the relation, can you enlighten me to understand why you wrote
this?

Cor
 
Cor,

Cor Ligthert said:
Can someone tell me how to access the Internet Explorer
Document from a vb.net usercontrol hosted in this
document ?
Me.parent, parentform, findform don't seem to work.

I am not sure if this is possible at all. If you don't get an answer
here, give microsoft.public.dotnet.framework.windowsforms[.controls] a
try.

I don't see the relation, can you enlighten me to understand why you wrote
this?

The OP wants to access the browser/document, a Windows Forms control
("browser control") is running on.
 
Thanks a lot Cor,

No, I don't want to access to a Axbrowser control in my usercontrol, I want
to access to the document
hosting my usercontrol.
My application is running as an administrative tool for a web site, it is
used to upload file to an Unix webserver.
It works fine, the problem is that I want my activeX can get access to the
document wich has opened it.
So I could, for example, get the domaine name of the website.
I can make it by using params in the HTML implementation of my usercontrol,
but it would be useful for my futur
developpements to get access to the document hosting my usercontrol.

P.
 
Yes Herfried,

That's it... I can't believe it's not so obvious to get the parent object of
an usercontrol, probably a
security matter. Anyway, hosted in a HTA window, in a domain name to wich I
gave fulltrust
(I could use strong names even). I'm stucked with that problem, for the
moment I just want to get
automaticaly the domaine name or location of the document that opened the
control. I can get these
infos from jscript in document and put them in params. But it would be
easier to get it directly from vb
in usercontrol.

P.

Herfried K. Wagner said:
Cor,

Cor Ligthert said:
Can someone tell me how to access the Internet Explorer
Document from a vb.net usercontrol hosted in this
document ?
Me.parent, parentform, findform don't seem to work.

I am not sure if this is possible at all. If you don't get an answer
here, give microsoft.public.dotnet.framework.windowsforms[.controls] a
try.

I don't see the relation, can you enlighten me to understand why you
wrote this?

The OP wants to access the browser/document, a Windows Forms control
("browser control") is running on.
 
Patrica,

Not that it is important because I think I have no answer, however to try it
so that maybe others can help you.

Did you make an Active X using .Net?
It works fine, the problem is that I want my activeX can get access to the
document wich has opened it.

And for that needs to have access to the IIS server variables?

Cor
 
Yes, I use .Net with VB from visual studio 2003
This is fun to code, and I can host my dll files in any kind of webserver.

P.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top