Click here to Skip to main content
15,895,283 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
See more:
I have a webBrowser control named webBrowser1.
When in debug mode, it have its default properties, and one of its default property is to "Open [a] link in New window". I want to change in code to open that link in the same window(not in new window as in default mode).
To summarize:
How to reset the default "Open link in New window" property, and make it "open link in the same window"?

And please, forgive me because I am not so good in expressing these things as it should, my level as programmer is not very good, and my english is not so advanced! If you will not understand something, just ask and I will add details as we go.
Posted
Updated 9-Feb-12 13:10pm
v3
Comments
Orcun Iyigun 7-Feb-12 17:51pm    
I think when you are opening a new url, you can use Navigate() method to do this. Have you tried it?
Sergey Alexandrovich Kryukov 7-Feb-12 19:45pm    
Unbelievable!
Nobody complained about you English, but I asked to specify the type of webBrowser1. You did not do it! There is no this type even now!

There is no such type -- "webBrowser". And "WebBrowser" is not a type -- this is a name of at least two different types.

Tell us what is that type.
--SA
_Q12_ 7-Feb-12 22:08pm    
for SAKryukov:
"""And please, forgive me because I am not so good in expressing these things as they are""" (but in general I make myself understood by the others who have a bit of good will; in the end,the idea matters, not the content of how its formulated), why are you so mean with me?
And really, I am over it, go ahead and downvote everything, but for you to know, you are not helping.
Sergey Alexandrovich Kryukov 9-Feb-12 13:14pm    
Look at what are your talking!

You say a lot of irrelevant stuff, and all is based on ambitions, but the business. What are your brain is busy with?

Telling I'm not not helping is a plain rude lie -- just look at my posts. And I don't like it.

After all you words, you failed to answer my simple question: tell me exact type of "webBrowser". This is all you had to tell so I could help you.
And how do your think I can vote your questions if you do not provide essential information and ignore my questions? Perhaps also reporting you for abuse... But this is not what I want; I want to help; but you are not giving me a chance.

You are literally the enemy of yourself. How anyone can help you if you are not helping yourself?

So, last chance. Please tell me the type of "webBrowser".
--SA
ChrisRaisin 14-Nov-21 18:40pm    
Sergey, you are the rudest, most unhelpful person I have experienced when reviewing responses to questions submitted to this site (or any site for that matter). You should be ashamed of the way you speak to people.

If you are using WebBrowser control of WindowsForms library, then you can use navigate property to open a URL in the WebBrowser control, without creating a new window, as below
C#
this.webBrowser1.Navigate("http://www.CodeProject.com");
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 9-Feb-12 13:18pm    
That is correct, my 5, but I'm very frustrated that OP still did not share with us the exact type of webBrowser1. The answer is only possible because this method is the same in WPF and Forms.
--SA
ProEnggSoft 9-Feb-12 19:31pm    
Thank you SAKryukov for the upvote
I suspect very strongly that the properties you get, are the ones set for IE on a global basis, given that you're running IE in a window, basically.

Playing with the IE control is not really a great way to learn programming, you'd do better to buy a book and work through it, or write basic apps that replace things like the calculator and notepad.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900