Linked lists?

  • Thread starter Thread starter John Young
  • Start date Start date
J

John Young

Hi, I have a couple of questions that I hope someone can help me with. I'm
pretty new to c# and have been able to use C# Express pretty well (it's a
great IDE).
My problem is twofold....
1. I am writing a basic web browser which allows the user to open windows
in a new tab page when requested. Now, I know how to create the tab pages
and the web browser controls in code, but I'm not sure of the best way to do
it. How would I store/create/delete each tab along with the web browser
control which is on that tab? I hope I am explaining this correctly. If
not please ask more questions...

2. The web browser has an event which is fired when the user right clicks
on the control and selects "Open in new window". The only problem is that I
can cancel the event using "e.Cancel = true;", which stops the opening of a
new browser window, but I cannot seem to find out which link the user has
right-clicked on. Does anyone have any idea?

Thanks for taking the time to read this.. I hope someone can help..

John

--

--
--------------------------------------------------------------
Polomint {uk}
===============================
try
{
Linux (any version)
}
catch
{
Format (mainHardDisk)
Install (Windows2000/XP/2003)
}
// You know you want to !!!
 
When you say C# Express, I think you are talking about framework 2.0 right?

Either way - doesn't matter.

I hope you are using the tabcontrol that comes with VStudio. If so, it must
have a tag property on it, use that to put the web browser control in it.

To answer your other question - I have to first ask you another question -
are you using the ie activex control through interop, or are you using the
new managed browser control?

It is possible to detect which link was clicked; I just gotta know what
you're usin' :) .. but since I think you might already be using framework
2.0, let me answer it anyway.

The webBrowser control has a Navigating event on it, you basically need to
subscribe it, thats all. Then e.Url would give you what you need.

The interop'ed browser (ActiveX Control) had a similar event on it.

- Sahil Malik
You can reach me thru my blog at
http://www.dotnetjunkies.com/weblog/sahilmalik
 
Sahil said:
When you say C# Express, I think you are talking about framework 2.0
right?

Either way - doesn't matter.

I hope you are using the tabcontrol that comes with VStudio. If so,
it must have a tag property on it, use that to put the web browser
control in it.

To answer your other question - I have to first ask you another
question - are you using the ie activex control through interop, or
are you using the new managed browser control?

It is possible to detect which link was clicked; I just gotta know
what you're usin' :) .. but since I think you might already be using
framework
2.0, let me answer it anyway.

The webBrowser control has a Navigating event on it, you basically
need to subscribe it, thats all. Then e.Url would give you what you
need.

The interop'ed browser (ActiveX Control) had a similar event on it.

- Sahil Malik
You can reach me thru my blog at
http://www.dotnetjunkies.com/weblog/sahilmalik

Apologies, I am using Framework 2.0 and the new managed WebBrowser control.
Thank you for the info about the tag property.
I think I may not have explained correctly about the new window event. When
a user right clicks on a link in the browser control, the context menu
appears which has 'Open in a new window' on it. When the user selects this,
the NewWindow event is fired. The only arguments passed through to my code
is one which lets me decide on whether the new window should be opened or
not. Here is the event code...wbStart is the name of the webbrowser
control. I need to find out what link the user is requesting to be opened
in a new window.

private void wbStart_NewWindow(object sender, CancelEventArgs e)

{

// User has requested to open a web page in a new window

e.Cancel = true; // stop new window from opening

// Create a new tabcontrol and webbrowser

}



Thanks again..

John
 
Sahil said:
Incidentally, why was the topic of this post "linked lists?" Are you
using a doubly linked list for back next browsing? Just curious :)

- Sahil Malik
You can reach me thru my blog at
http://www.dotnetjunkies.com/weblog/sahilmalik

Oops, the linked list information was supposed to be my 3rd question, I was
going to ask which was the most efficient way of using a doubly linked list
for exactly that reason. Any links appreciated..

Thanks again..

John

--
--------------------------------------------------------------
Polomint {uk}
===============================
try
{
Linux (any version)
}
catch
{
Format (mainHardDisk)
Install (Windows2000/XP/2003)
}
// You know you want to !!!
 
Back
Top