![]() |
Getting the child handle |
Post Reply ![]() |
Author | |
eSynaptic ![]() Newbie ![]() Joined: 07 March 2006 Status: Offline Points: 3 |
![]() ![]() ![]() ![]() ![]() Posted: 19 March 2011 at 9:23pm |
I am dynamically loading a form as a tab item. When I hit the close button on the tab, how can I get the handle of the form so I can unload it when the tab closes?
example: 'load the form as a tab item With wndTab Set nTab = .InsertItem(0, "Example Tab", form1.hWnd, 0 End With Now... using the NavigateButtonClick event, how can I get the loaded form to unload it? Thank you!! Jason |
|
![]() |
|
eSynaptic ![]() Newbie ![]() Joined: 07 March 2006 Status: Offline Points: 3 |
![]() ![]() ![]() ![]() ![]() |
This is what I am doing... is there an easier way?
Private Sub wndTab_NavigateButtonClick(ByVal Id As Long, Cancel As Variant) On Error Resume Next Dim i As Long Dim szTag As String Dim oFrm As Form szTag = wndTab.Selected.Tag 'find the tag name For i = Forms.Count - 1 To 1 Step -1 DoEvents If Forms(i).Tag = szTag Then Unload Forms(i) End If Next End Sub |
|
![]() |
|
Xander75 ![]() Senior Member ![]() ![]() Joined: 26 April 2007 Status: Offline Points: 353 |
![]() ![]() ![]() ![]() ![]() |
Hi,
Use the following code to resolve the issue you have of closing the child form.
|
|
Product: Xtreme SuitePro (ActiveX) v15.3.1
Platform: Windows 7 64-bit (SP1) Professional Edition Languages: C#.Net using Visual Studio 2012 & Visual Basic 6.0 (SP6) |
|
![]() |
|
Xander75 ![]() Senior Member ![]() ![]() Joined: 26 April 2007 Status: Offline Points: 353 |
![]() ![]() ![]() ![]() ![]() |
Or if you'd prefer to use an API, you can do this with one line of code in the "NavigateButtonClick" event...
|
|
Product: Xtreme SuitePro (ActiveX) v15.3.1
Platform: Windows 7 64-bit (SP1) Professional Edition Languages: C#.Net using Visual Studio 2012 & Visual Basic 6.0 (SP6) |
|
![]() |
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 |