Click here to Skip to main content
12,699,492 members (32,563 online)
Rate this:
Please Sign up or sign in to vote.
See more: VB Windows VB.NET

i've made an web browser with tabs
now what i want is a new tab button that inserts another tab page before that button
i know you can do this with this code
Me.customtabcontrol1.TabPages.Insert(Me.customtabcontrol1.TabCount - 1, "Newtab" & Me.customtabcontrol1.TabCount, "New")

but i've got tabpages that contain another Form2.vb as a control
do you have any ideas how i can fix it so it inserts the tabpage with the form2.vb before the tabpage i use as a "button"

this is the code i use to add a tab:

        Dim t As New TabPage
        Dim newtab As New tab
        newtab.TopLevel = False
        newtab.Dock = DockStyle.Fill
        customtabcontrol1.Dock = DockStyle.Fill
        customtabcontrol1.ContextMenuStrip = ContextMenuStrip1

best regards,
Bart de Lange
Posted 28-Jan-13 9:06am
Updated 29-Jan-13 5:10am
Sergey Alexandrovich Kryukov 28-Jan-13 19:27pm
The question is easy, but... You need to tag your UI library you use. Forms? WPF? something else?
[EDIT] OK, from the context, I can see it's Forms, but... it's not good for you if you don't tag it. You need people to see what is your topic before even opening this page.
Bart de Lange 29-Jan-13 1:06am
i've updated the question

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Never ever use a form as a child control of some other control. Use something like a Panel.

You already know how to insert a tab page. In most cases, you also need to show the newly created tab page. For this purpose use one of these properties:[^],[^].

Bart de Lange 29-Jan-13 1:06am
To use a panel is no option because my child form contains a webkit browser a searchbar back button and a lot more so that's to much to design with code for me and the others are also no option

i could send you a picture if i'd know how to do that
Wrong. Using a child window is not an option. More exactly, you can force it to be a child by setting TopLevel to false, but... nothing good.

Your reply is just wrong. Everything you can put in the form, you can put in Panel or immediately in WebPage. I mean it: absolutely everything. Just do it (copy-paste under Designer, for this matter), and then you will see.

Not need to send a picture; this matter is fully obvious.

Bart de Lange 29-Jan-13 1:42am
I dont know what you mean

I have this
(Form1 )
((Tab.vb. ))

The tab.vb is created as control in runtime
Because it contains events and
the disign to imitate a google Chrome kind of webbrowser

This is the vid i used for the disign

So how do i do that
Do what?! In your diagram, you are mixing up a control and a file. How can I talk with you.
You need to do what I told you; if you don't understand it, explain what.
Bart de Lange 29-Jan-13 1:48am
Look the vid i send u a couple of minutes/parts then you see what i'm trying to manage
15 minutes! Are you serious? Just stop it.
Bart de Lange 29-Jan-13 2:34am
Pic better ????
That's why you probably have some problem with programming, which is an art to express everything in words... :-)
Bart de Lange 29-Jan-13 4:21am
When i can i sent you one,
how do i do that??
Bart de Lange 29-Jan-13 6:41am
You know how chrome looks like???
Im trying to imitate that with 2 forms one with only the tabcontrol(form1.vb)
And the other containing the url bar, back button, forward, search, openwebkitsharp webkitbrowser, a favorits bar and a settings bar(tab.vb).

Ive done it that way because its easyer for me to handle the events and such
Now i want to create a tabpage that functions as a button
So that it creates a new tab before the "button"
How do i do that.
I dont understand how to do it with a pannel

I hope ive explained it better this way
Bart de Lange 29-Jan-13 6:45am
When im back from school i'l send you the code for the newtab i use

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.170118.1 | Last Updated 29 Jan 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100