Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB Forms and Hwind. please help

Status
Not open for further replies.

wadey

Programmer
Jun 6, 2006
54
GB
Hi,

I'm trying to set a reference to a loaded form using the hwind property.

example:-

dim objForm as form

set objForm = <----another form of which i have the hwind, but do not know the code. Anyone

Regards
 
[tt]Set objForm = FormFromHwnd(hWindow)[/tt]

Where FormFromHwnd will be coded like this.
___
[tt]
Function FormFromHwnd(hWnd As Long) As Form
Dim F As Form
For Each F In Forms
If F.hWnd = hWnd Then
Set FormFromHwnd = F
Exit For
End If
Next
End Function[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top