|
-
Apr 30th, 2006, 04:08 PM
#1
Thread Starter
Hyperactive Member
[2005] Adding tabbed pages?--PLEASE HELP!
Hi. I was wondering if there was a way to add a tabpage with controls such as a webbrowser on it but when you fire the event again the controls are still there. Here is my code for the event:
TabControl1.TabPages.Add(tb)
tb.Controls.Add(wb)
wb.Dock = DockStyle.Fill
wb.Navigate(textbox1.Text)
TabControl1 is the TabControl, tb is the new tabpage, wb is the new webbrowser, and textbox1 is the url box. When I fire this event twice, the first webbrowser dissapears and the new tabpage has nothing on it. I'm taking a guess that it's a naming problem but I'm wondering if there is another way to address it. am not trying to reparent the web browser. I am trying to create a new web browser for each tabpage but they will all have the same functions as the original such as if you clicked the back button the web browser that you are currently viewing will go back one page, etc. Please HELP! Thanks.
-
Apr 30th, 2006, 05:30 PM
#2
Member
Re: [2005] Adding tabbed pages?--PLEASE HELP!
i dont think i have to right code for you, i think you can handle this but what you do is make a nw instance of the webbrowser,
then of course you asign wb its properties and what not.
then create the tabpage and add wb to it.. make sure to specify size and what not...
-
Apr 30th, 2006, 06:30 PM
#3
Re: [2005] Adding tabbed pages?--PLEASE HELP!
You should define your own class that inherits TabPage and place the code to add the desired controls in it. You can then create instances of your class and use them wherever TabPage object sare required, so you can create one and add it to a TabControl and the WebBrowser, etc. will be there without additional code.
-
May 1st, 2006, 11:06 PM
#4
Thread Starter
Hyperactive Member
Re: [2005] Adding tabbed pages?--PLEASE HELP!
I tried the way c0rrupt told me and when I added two tabpages the controls on the tabpages were gone. I think this has to do with the names of the tabpages. Is there anyway to randomly generate a string? - Thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|