CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2001
    Posts
    2

    Help not being displayed from MDI parent

    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 ...


  2. #2
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726

    Re: Help not being displayed from MDI parent

    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
    ...at present time, using mainly Net 4.0, Vs 2010



    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

  3. #3
    Join Date
    Sep 2001
    Posts
    2

    Re: Help not being displayed from MDI parent

    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.


  4. #4
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726

    Re: Help not being displayed from MDI parent

    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
    ...at present time, using mainly Net 4.0, Vs 2010



    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured