473,511 Members | 14,951 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Deleting Tabs from Tab Control

meh
Hi All;
After creating a new tab if I delete the tab I cannot close my app from the
X in the upper right of the window. NE1 have a clue why.
Tried stepping through the delete seems to work fine but I can not close the
app??????

I am creating a new Tab this way.....

ElseIf e.Button Is tbNewVol Then

Dim tp As New TabPage()

Dim lbl As New Label()

Dim cboBox As New ComboBox()

Dim tv As New TreeView()

Dim tb As New ToolBar()

tp.Controls.AddRange(New System.Windows.Forms.Control() {tv, cboBox, lbl,
tb})

' Set control's properties here.

tb.Dock = DockStyle.Right

tb.Buttons.AddRange(New System.Windows.Forms.ToolBarButton()
{Me.btnClrCombo, Me.tb2Sep1, Me.tbScratch, Me.tb2Sep2, Me.tbNewVol,
Me.tbSep3, Me.tbExpandAll, Me.tbCollapseAll, Me.tbSep4, Me.tbMailTo})

tb.Appearance = ToolBarAppearance.Flat

tb.ButtonSize.Height.Equals(16)

tb.ButtonSize.Width.Equals(16)

lbl.BorderStyle = BorderStyle.Fixed3D

lbl.Dock = DockStyle.Top

cboBox.Dock = DockStyle.Top

tv.Dock = DockStyle.Fill

tv.ContextMenu = mnuTreeContext

Me.TabControl.TabPages.Add(tp)

Dim tabCount As Integer = TabControl.Controls.Count

TabControl.SelectedIndex = TabControl.TabPages.IndexOf(tp)

TabControl.SelectedTab.Text = ("New Volume " & ((TabControl.TabCount() +
1) - 2))

CurrTree = tv

tb = ToolBar2

CurrCombo = cboBox

CurrLabel = lbl

I am deleting the Tab this way....
Private Sub tabMenuDelete_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles tabMenuDelete.Click

Dim Test As String

Test = TabControl.SelectedTab.Text()

TabControl.TabPages.Remove(TabControl.SelectedTab)

TabControl.Refresh()

End Sub



Nov 20 '05 #1
3 1561
Meh,

* "meh" <re******************@cox.net> scripsit:
After creating a new tab if I delete the tab I cannot close my app from the
X in the upper right of the window. NE1 have a clue why.
Tried stepping through the delete seems to work fine but I can not close the
app??????


Seems to be this "bug":

<http://www.jelovic.com/weblog/e41.htm>

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #2
meh
thx Herfried;

Yes it is that bug......been trying to figure out the
OnControlRemoved()

Do you know of any samples I might look at....I still don't understand the
..Net help it seems to tell me what this event is but not how to use
it........

tia
meh

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:c1*************@ID-208219.news.uni-berlin.de...
Meh,

* "meh" <re******************@cox.net> scripsit:
After creating a new tab if I delete the tab I cannot close my app from the X in the upper right of the window. NE1 have a clue why.
Tried stepping through the delete seems to work fine but I can not close the app??????


Seems to be this "bug":

<http://www.jelovic.com/weblog/e41.htm>

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>

Nov 20 '05 #3
meh
If any one is interested the work around (fix) was

The tab I built had controls on it Label, ComboBox, TreeView....

If I delete the controls first then I can delete the TabPage with no
detrimental effects on the app. i.e. It closes like a champ.

Thx to all

meh

"meh" <re******************@cox.net> wrote in message
news:ua***************@TK2MSFTNGP11.phx.gbl...
thx Herfried;

Yes it is that bug......been trying to figure out the
OnControlRemoved()

Do you know of any samples I might look at....I still don't understand the
.Net help it seems to tell me what this event is but not how to use
it........

tia
meh

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:c1*************@ID-208219.news.uni-berlin.de...
Meh,

* "meh" <re******************@cox.net> scripsit:
After creating a new tab if I delete the tab I cannot close my app
from
the X in the upper right of the window. NE1 have a clue why.
Tried stepping through the delete seems to work fine but I can not
close
the app??????


Seems to be this "bug":

<http://www.jelovic.com/weblog/e41.htm>

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>


Nov 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1978
by: Paiam Salavati | last post by:
I want to change the the color of the tabs and the color of TabControl itself in a TabControl. Therefore I wrote the following code in my customized TabControl-class: this.DrawMode =...
1
2223
by: Mark C | last post by:
I have yet another problem with the infamous tab control in my Access 97 database. I have a form with a tab control with 4 tabs on each tab is a sub form bound to a form. When the main form loads...
6
1242
by: Mike | last post by:
I'm creating a "portal" type web app and i want to use a "tab" appearance for navigation. How can i create a "tab" look navigation system for my portal?
11
2274
by: Steve B. | last post by:
How can I keep the ComboBox textbox empty of datasource items when my local application starts AND keep them empty even after the user clicks different Tabs on the form. I welcome any questions....
0
1067
by: Ashutosh | last post by:
I have 3 tabs in the tab control of a dialog application. The user can resize the application. I want these 3 tabs (not the form but the place where user click to switch among tabs) to spread...
135
7342
by: Xah Lee | last post by:
Tabs versus Spaces in Source Code Xah Lee, 2006-05-13 In coding a computer program, there's often the choices of tabs or spaces for code indentation. There is a large amount of confusion about...
3
2007
ADezii
by: ADezii | last post by:
One frequently asked question at TheScripts is how to set focus/make active a specific Tab on a Tab Control other than clicking on it. Before I provide the answer, I feel as though a little summary...
4
44026
ADezii
by: ADezii | last post by:
One frequently asked question at TheScripts is how to set focus/make active a specific Tab on a Tab Control other than clicking on it. Before I provide the answer, I feel as though a little summary...
7
3738
by: Phil Reynolds | last post by:
I'm using a tab control in Access 2000, and the user requested to have buttons in the form header, instead of the built-in tabs (so that when they scroll down, they can still switch tabs). Now,...
0
7137
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7417
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7074
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5659
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5063
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4734
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1572
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
780
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
445
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.