Print Page | Close Window

Closing Tabs on Tabcontrol

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Suite Pro
Forum Description: Topics Related to Codejock Suite Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=12546
Printed Date: 01 November 2024 at 12:32am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Closing Tabs on Tabcontrol
Posted By: nando_uy
Subject: Closing Tabs on Tabcontrol
Date Posted: 27 October 2008 at 11:12pm

I have a Tabcontrol with no tabs at all. They create at runtime attaching forms at these newly created tabs.

IE:
Private Sub NewReport()
Set pageReport = New frmReport
l_Index = TabControl.ItemCount
Set oTabItem = TabControl.InsertItem(l_Index + 1,"Report", pageReport.hwnd, 0)
TabControl.Item(l_Index).Selected = True
End Sub
 
How can I close /destroy/unload all the instances of pageReports before unload the form?
The app not ended if don't!!!
Or, directly CRASH?
Any help???



Replies:
Posted By: Oleg
Date Posted: 28 October 2008 at 3:10am
Hi,
Move pageReport  as form variable and in Unload event add
Unload pageReport


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: nando_uy
Date Posted: 28 October 2008 at 5:05am

Can you show me an example?

In your Docking Pane sample folder, there's something like you suggest me. So I can't figure how can I implements this for my specific case, because I haven't an form array.

And, I need to remove all the instances of pageReport
Any Example?
 
Many, many thanks Oleg, you're the man!


Posted By: Mr.Den
Date Posted: 31 October 2008 at 8:56pm
Have you tried this in the main form's form_queryunload sub:
 
dim iCtr as integer
 
for iCtr = Forms.count -1 To 0 Step -1
    Unload Forms(iCtr)
Next iCtr



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net