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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Count the number of child forms

Status
Not open for further replies.

Flupke

Programmer
Jun 26, 2002
94
BE
How can I count the number of the open child forms of a MDI form in VB.NET? The purpose is to set the enable status of a menu-item to false when there is no longer a child form open.

Many thanks,

Michel
 
How can I detect on which button of a toolbar the mouse is pointing at, so I can show that information in e.g. a statusbar? The mousemove recognizes the toolbar, but not tne separate buttons.

Many thanks,

Michel
 
try this


'************************************************************************************
'Procedure: m_GetChildCount '
'Description: return the number of mdi children '
'Parameters: oMe - mdi parent form '
'Returns: integer '
'************************************************************************************
Public Function m_GetChildCount(ByVal oMe As Form)
Dim oChild As Form
Dim i As Integer

For Each oChild In oMe.MdiChildren
If Not (oChild Is oMe) Then
i += 1
End If
Next oChild

Return i
End Function

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top