Go Back  Xtreme Visual Basic Talk > Visual Basic .NET (2002/2003/2005/2008, including Express editions) > .NET General > vb.net 2003 forms bug?


Reply
 
Thread Tools Display Modes
  #1  
Old 09-07-2005, 03:17 PM
Zumwalt Zumwalt is offline
Contributor
 
Join Date: Sep 2003
Location: Tampa, FL
Posts: 474
Default vb.net 2003 forms bug?


On my form, I added a tab control, no biggie, then on the second tabpage in the collection of tabs, I add a tab control, looks good so far, total of 8 tabs (tabpages(0) through tabpages(7)), so far so good, now I have my max pages.

I have different levels of security as to who can use what tabs, so I now create me an arraylist, place all the tabs in the arraylist, and clean the tabpages from the tabcontrol collection.

Alright, this works, I use a select case statement to look at the securitylevel the user has, then fill the tabpages of the original tabcontrol with the pages that user will use.

No problem so far, or so I thought.

If I do not add the tabpage back to the tabcontrol that has the child tabcontrol on the tabpage, it won't let me close the application, can't use the X, can't use finalize, can't even dispose the app, have to end task.

*scratches his head*

So, I am like hmm.. I take the child control on the tabpage with the tabcontrol, get a collection of the controls on the tabpages in the tabcontrol, dispose them all, then dispose of all the tabs in this tabcontrol that sits on this tabpage, then finally dispose of the tabpage itself by removing it at location or just remove.

No joy.

Same problem, no error, just can't click the X or close the application.
I have no try/catch yet in place, this way I can see it throw the exceptions immediately, but the thing is, no exception is thrown, the application is still responding, working like a champ, but I just can't quit it.

Using another application I wrote similar to spy++, I walk through my applications window handles, see the handle of the control before I nuke the tab that contains the control, refresh the app after I remove the tab that contains it, and no more handle, heck, nothing that looks like it would be an issue.

Only solution I could come up with was to use another method to present the data on that tab and get rid of the tabcontrol that set on the tabpage, would have loved to left it there, gave me more options.

Well, not more options, just more room to work with the current options.

Anyone have any clue what caused this?
I was thinking of orphaned control, but there is no proof the control is orphaned.
Reply With Quote
  #2  
Old 09-08-2005, 10:57 AM
Machaira's Avatar
Machaira Machaira is offline
Jedi Coder

* Expert *
 
Join Date: Aug 2002
Location: Abingdon, MD
Posts: 3,438
Default

Hmm, I don't have any problems shutting down an app where I've removed tabpages on a child tabcontrol. Can you post the app?
Reply With Quote
  #3  
Old 09-08-2005, 11:40 AM
alex19063 alex19063 is offline
Centurion
 
Join Date: Jul 2005
Posts: 126
Default

I have sh1t like that happen to my app too. Application.close() won't do anything either.

so I went back to my VB6 roots... I went into the form1.closing event and added "End"

that kills the sucker.
Reply With Quote
  #4  
Old 09-08-2005, 04:44 PM
Zumwalt Zumwalt is offline
Contributor
 
Join Date: Sep 2003
Location: Tampa, FL
Posts: 474
Default

I'd post the project, but testing it won't do much good, since its part of a larger solution and won't run without the counter parts.

I'll take the code from the form tomorrow that had the stacked tab controls and just post that, to busy today dealing with the web application piece of it to even think of it.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->