![]() |
Closing Tabs on Tabcontrol |
Post Reply ![]() |
Author | |
nando_uy ![]() Newbie ![]() Joined: 26 February 2005 Location: Uruguay Status: Offline Points: 9 |
![]() ![]() ![]() ![]() ![]() 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???
![]() |
|
![]() |
|
Oleg ![]() Senior Member ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hi,
Move pageReport as form variable and in Unload event add
Unload pageReport
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
nando_uy ![]() Newbie ![]() Joined: 26 February 2005 Location: Uruguay Status: Offline Points: 9 |
![]() ![]() ![]() ![]() ![]() |
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!
|
|
![]() |
|
Mr.Den ![]() Groupie ![]() ![]() Joined: 26 August 2007 Status: Offline Points: 50 |
![]() ![]() ![]() ![]() ![]() |
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
|
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |