Welcome to Dream.In.Code
Getting VB.NET Help is Easy!

Join 136,245 VB.NET Programmers for FREE! Get instant access to thousands of VB.NET experts, tutorials, code snippets, and more! There are 2,212 people online right now. Registration is fast and FREE... Join Now!




How to remove a tab from tab control?

 
Reply to this topicStart new topic

How to remove a tab from tab control?

rakyomin
13 Oct, 2008 - 08:46 AM
Post #1

D.I.C Head
**

Joined: 12 Sep, 2008
Posts: 77


My Contributions
I know how to add a tab.. or many tab according to what user desires.
vb

Dim newTabPage As New TabPage
newWebBrowser = New WebBrowser

newTabPage.Text = "TabPage" & tabBrowserFace.TabPages.Count + 1
'add browser to the tab control
newTabPage.Controls.Add(newWebBrowser)
newWebBrowser.Dock = DockStyle.Fill
'add the new tab
Me.tabBrowserFace.Controls.Add(newTabPage)


The above code embeds webbrowser control, but i got a problem of removing the tab after created... I looked for the tabcontrol class members i cannot find any methods or properties that can remove the selected tab and webbrowser...
help...

User is offlineProfile CardPM
+Quote Post

PsychoCoder
RE: How To Remove A Tab From Tab Control?
13 Oct, 2008 - 09:33 AM
Post #2

using DIC.Core;
Group Icon

Joined: 26 Jul, 2007
Posts: 8,983



Thanked: 125 times
Dream Kudos: 8625
Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, Boo.Net

My Contributions
You use the Remove method.
User is offlineProfile CardPM
+Quote Post

rakyomin
RE: How To Remove A Tab From Tab Control?
13 Oct, 2008 - 09:57 AM
Post #3

D.I.C Head
**

Joined: 12 Sep, 2008
Posts: 77


My Contributions
Thank you for the reply.

I manage to figure out myself just now... i am using remove method but from a different reference from you.

I am using TabControl.Controls.Remove(TabControl.SelectedTab).


User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/2/08 03:48AM

Live VB.NET Help!

VB.NET Tutorials

Reference Sheets

VB.NET Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month