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

Determining which child is selected from Window list

Status
Not open for further replies.

zggs90

Programmer
Sep 3, 2001
58
0
0
GB
I have a MDI program with a menu item "Windows" which lists all the child windows. I would like to intercept the name of the window that is selected by the user (so that I can do some other processing).

I have tried intercepting in the child window "GotFocus" "Activate" but that doesn't work.

Any ideas please?
 
Harleyquinn, thanks for your response but I need some form of trigger to indicate that the user has selected a child window.

Any ideas.
 
Many thanks

I don't mind whether it is done on the child side or the Windows menu all I want to get is some indication that the user has selected another child. Then

If childselected is "Child1" then
do something
elseif childselected is "Child2" then
do something else
else
do something altogether different
end if

The problem I have is triggering the above code after the child window is selected.

 
So you definitely can't use:
Code:
Private Sub mnuWindowListList_Click(Index As Integer)

childselected = "Child" & Index

Select Case childselected

    Case "Child1"
        [green]'do something[/green]
    Case "Child2"
        [green]'do something else[/green]
    Case Else
        [green]'do something altogether different[/green]
End Select
End Sub
On the Menu of the MDIForm????

Harleyquinn

---------------------------------
For tsunami relief donations
 
Might have misinterpreted your post. Do you mean when the user selects an already open child window not using the menu, rather by clicking the actual child window itself???

Harleyquinn

---------------------------------
For tsunami relief donations
 
Harleyquinn , I must be going mad. I have tried the "Activate" route before and it failed to work.

I have tried again and now it seems to work OK. Not sure why.

Anyway thanks for all your help.
 
This may not be *exactly* relevant here. But...

When working with an MDI application, remember that there is a property of the MDI form called .ActiveForm This property points you to the form with the focus.

This little tip may not help with your immediate problem, but may come in handy later.
 
gmmastros, thanks for the comment. Probably not appropriate with my problem.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top