PC Review


Reply
Thread Tools Rate Thread

Deleting Tabs from Tab Control

 
 
meh
Guest
Posts: n/a
 
      23rd Feb 2004
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







 
Reply With Quote
 
 
 
 
Herfried K. Wagner [MVP]
Guest
Posts: n/a
 
      23rd Feb 2004
Meh,

* "meh" <(E-Mail Removed)> 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>
 
Reply With Quote
 
meh
Guest
Posts: n/a
 
      24th Feb 2004
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]" <hirf-spam-me-(E-Mail Removed)> wrote in message
news:c1e2jn$1hn9lh$(E-Mail Removed)...
> Meh,
>
> * "meh" <(E-Mail Removed)> 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>



 
Reply With Quote
 
meh
Guest
Posts: n/a
 
      26th Feb 2004
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" <(E-Mail Removed)> wrote in message
news:uaUAkLo%(E-Mail Removed)...
> 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]" <hirf-spam-me-(E-Mail Removed)> wrote in message
> news:c1e2jn$1hn9lh$(E-Mail Removed)...
> > Meh,
> >
> > * "meh" <(E-Mail Removed)> 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>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Deleting Tabs or Icons Stefan B Rusynko Microsoft Frontpage 1 5th Jan 2007 09:21 AM
deleting tabs =?Utf-8?B?dGRlcm9zZQ==?= Windows XP Internet Explorer 1 24th May 2006 08:23 PM
Deleting some tabs from sum formula =?Utf-8?B?REdN?= Microsoft Excel Worksheet Functions 1 21st Jan 2006 08:52 PM
Deleting tabs in Excel shoey812@yahoo.com Microsoft Excel Programming 2 9th Mar 2005 06:52 PM
Deleting tabs =?Utf-8?B?UGV0ZXIgT3ZyaW4=?= Microsoft Word Document Management 1 27th Oct 2004 01:34 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:02 PM.