Welcome to Forums Sign in | Join | Help | Forums
in Search


keeping a modal form on top

Last post 02-12-2007 7:57 AM by Mike Bradfield. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 02-08-2007 1:11 PM

    • David Zeidman
    • Top 25 Contributor
    • User Since: 2002
    • Posts 326
    • Organization: Zeidman Development
    • Products:  Blackbaud Direct Marketing, Blackbaud Enterprise CRM, The Information Edge, The Raiser's Edge

    keeping a modal form on top

    This is a problem I have had forever. If I create a VBA UserForm and show it modally on, say a constituent form it does not remain on top if I go away from RE and back to again. What happens is that the constituent window is shown but since my modal form is still around (but hidden) it I cannot access either. The only way around this is to bring another window (not an RE one) in front of it and then minimize it. The modal form then shows. This is a known issue with Blackbaud ( KB entry BB21890) but I was wondering if anyone had a workaround. I heard someone say that you could create a DLL and call the form from within the dll and that this would work. I can see how it might work but I am reluctant to introduce a dll as this complicates deployment Any suggestions? Thanks David Zeidman Development http://www.zeidman.info
    David Zeidman
    Zeidman Development
    http://www.zeidman.info

    Check out my RE API blog
    http://www.re-decoded.com
  • 02-08-2007 7:35 PM In reply to

    • Mike Bradfield
    • Not Ranked
    • Posts 3
    • Organization: Guide Dogs for the Blind Association

    keeping a modal form on top

    Hi David I haven't tried this, but think something along the following lines might work. Long winded but worth a try! i) Create an API driven timer at form load (http://www.vbforums.com/showthread.php?p=1888414  revealed by a quick google) ii) At form load, do an API scan (EnumChildWindows?) to list all the RE windows currently on display. You're interested in the name and Z-order of these windows, the current form, and the RE parent form as well. iii) Start the timer iv) On timer: Get the title of the top most window (i.e. the one with Z-order of 0). If it's not one of the ones you recorded at form open, then it's another application that has focus, so ignore. If it's one of your recorded windows, then RE has regained focus, but your form isn't on top. Force it forwards using SetForegroundWindow API call. Let me know if this makes sense, and if so whether you have any luck with it! M --- Edited at 2/8/2007 7:36:09 PM by Mike Bradfield
  • 02-08-2007 8:12 PM In reply to

    • Peter Falconer
    • Top 500 Contributor
    • Posts 36
    • Organization: Oxfam Australia
    • Products:  The Raiser's Edge

    keeping a modal form on top

    This is a semi-solution. Try navigating around the open windows with Alt-Esc rather than Alt-Tab. This seems to bring up the RE modal windows as well (although I have seen instances where this doesn't seem to work, but I'm not sure if there's a pattern or not.)
  • 02-12-2007 7:51 AM In reply to

    • David Zeidman
    • Top 25 Contributor
    • User Since: 2002
    • Posts 326
    • Organization: Zeidman Development
    • Products:  Blackbaud Direct Marketing, Blackbaud Enterprise CRM, The Information Edge, The Raiser's Edge

    keeping a modal form on top

    Thanks for that suggestion. I have now managed to implement it and it works really great. I have kept it simple so that rather than capture all the RE window I just capture the "parent" i.e. where the modal form is called from. Then I do a check to see if the current window in focus is the parent and if it is I put the modal window on top. That way I do not need to look at the Z-Order specifically. If anyone is interested in the code then let me know and I can make it available. Thanks David Zeidman Development http://www.zeidman.info
    David Zeidman
    Zeidman Development
    http://www.zeidman.info

    Check out my RE API blog
    http://www.re-decoded.com
  • 02-12-2007 7:57 AM In reply to

    • Mike Bradfield
    • Not Ranked
    • Posts 3
    • Organization: Guide Dogs for the Blind Association

    keeping a modal form on top

    Fab; I wondered whether that would. I'd be interested in seeing the code, as I'm sure my users will experience the same problem!
Page 1 of 1 (5 items)