Click to See Complete Forum and Search --> : Help not being displayed from MDI parent
Anthony Vaughan
September 4th, 2001, 05:04 AM
I have a VB 6 MDI application.
I can invoke help by pressing the F1 key providing an MDI child is displayed, help is not displayed if only the parent form is shown.
I have tried intercepting the keyboard, but this does not work on MDI parent forms.
Any ideas... thanks ...
Cimperiali
September 4th, 2001, 06:57 AM
You can add a toolbar to MDi parent, and a textbox (locked= true) to it.
Specifying your help file in project, and running it, when pressing F1 you will see your help shown as long as the textbox holds the focus.
Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood, TCartwright, Bruno Paris, Dr_Micahel
and all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
The Rater
Anthony Vaughan
September 4th, 2001, 07:57 AM
Almost works. I have a toolbar that uses the imagelist to display buttons. I added the textbox at position -2000, so that it is not visible. Works fine first time, but if MDI child shown then closed, help no longer works, even if the textbox still has the focus. I have to switch to another app. and back for it to work. Using Text1.Setfocus (even though has focus) would solve the problem, but I don't want to do it this because
1. It would mean modifying all code to setfocus whenever no children or modal dialogs are shown/closed.
2. I have a number of apps. that would need changing.
I know using a Timer and setting focus if no other forms would work, but again I feel this is rather messy.
Any better ideas.
Cimperiali
September 4th, 2001, 08:24 AM
I agree. It would be easy if you add a button to the toolbar for displaing help with a click of the mouse. Unluckily Mdi forms Parent do not intercept keypressed...You may override this with a general keyboard hook, but for this you will need someone else help (ClearCode seems to know this issue well).
Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood, TCartwright, Bruno Paris, Dr_Micahel
and all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
The Rater
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.