|
-
Oct 13th, 2000, 10:21 AM
#1
Thread Starter
Fanatic Member
I have a program with an MDI form and several children, and to keep track of them as a new child is loaded, I assign each a unique tag, and use a variable to hold the tag of the currently used child. The problem is that I have the command that sets the variable to a specific window inside the main child form's GetFocus event:
Code:
Private Sub Form_GetFocus()
CurrentWindowTag = Me.Tag
End Sub
I would think this works, but for some reason the GetFocus event for the child forms doesn't seem to fire. I set up a thing to print CurrentWindowTag, but when I switch between different child windows, the tag never seems to change, even though each window has a unique tag. Is there something weird about MDI child forms and how they get/lose the focus? Does a form get the focus when any control on it gets the focus?
I'm baaaack...
VB5 Professional Edition, VC++ 6
Using a 1 gHz Thunderbird, 256 mb RAM, 40 gb HD system with Win98se
I feel special because I finally figured out how to loop midis: Post link
I'm a fanatic too 
-
Oct 13th, 2000, 10:33 AM
#2
Guru
Try the Activate event instead.
-
Oct 13th, 2000, 10:59 AM
#3
transcendental analytic
well there's also a property called activeform in the MDIform that returns the child form that has the focus, so you could access it's Tag by:
Code:
MDIForm1.ActiveForm.Tag
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|