Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Docking Pane
  New Posts New Posts RSS Feed - Accessing Child Object from Pane.Handle
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Accessing Child Object from Pane.Handle

 Post Reply Post Reply
Author
Message
ianp View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 19 December 2003
Location: United Kingdom
Status: Offline
Points: 119
Post Options Post Options   Thanks (0) Thanks(0)   Quote ianp Quote  Post ReplyReply Direct Link To This Post Topic: Accessing Child Object from Pane.Handle
    Posted: 30 January 2004 at 3:14am

Hi,

I'm using the ActiveX docking pane control. Once I have created a Pane and set the Pane.Handle to the form to be used as the Child Window, I am trying to get access to the controls on the form of the Child Window.

Can anyone suggest how I can do this from the Pane.Handle? Ideally what I am looking for is something like:

Set frm = Pane.Handle

frm.command1.caption = "My New Value"

So the question really is, how do you turn a window handle (hwnd) into a vb form object?

Thanks

Ian

 

 

Using both



Edited by ianp
Back to Top
robs View Drop Down
Groupie
Groupie


Joined: 09 November 2003
Status: Offline
Points: 84
Post Options Post Options   Thanks (0) Thanks(0)   Quote robs Quote  Post ReplyReply Direct Link To This Post Posted: 04 February 2004 at 9:33pm

Ian,

Will something like this work for you?:

Dim f As Form
Dim v As Variant
For Each v In Forms
    If v.hWnd = pane.Handle Then
      Set f = v
      Exit For
    End If
 Next

If Not f Is Nothing Then
  f.command1.Caption = "My New Value"
End If

Back to Top
ianp View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 19 December 2003
Location: United Kingdom
Status: Offline
Points: 119
Post Options Post Options   Thanks (0) Thanks(0)   Quote ianp Quote  Post ReplyReply Direct Link To This Post Posted: 06 February 2004 at 1:14pm

Thanks for your message. I had two appraoches to this: maintain a global/form variable with an array of pointers to the  forms; or get the form object back from a loop (as you suggested).

Dunno if it's just me but both seem kinda excessive so thought there maybe an API or function that I hadn't heard of.

Oh well, sticking with the "for f in forms" approach for now as  it appears faster and easier.

 

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.203 seconds.