Non-Modal Pop-Up

molloyjh

Registered User.
Local time
Today, 21:36
Joined
Jun 23, 2009
Messages
13
Hi all,

I have a pop-up form that I want to be able to close by clicking outside of it. It is not modal, but I have no idea how to identify whether the mouse click is inside or outside the form. Anyone any ideas?

Thanks,
John.
 
This is an odd requirement. I would suspect you need to capture the event on the underlying form.
 
Ken,

I will join in with you that this seems like a very odd requirement.

mollyjh,

If you don't mind would you give us some insite to just why you want or need this type of behavior?
 
I don't think this is normal. I would say don't do this. What for? Surely you can do whatever you want another way.
 
Hi all,

I think I'm just trying to be a bit too smart for my own good! I have set up a call tracking db and have the forms set up to have drop-down menus (File menu, Edit menu etc). I have the drop downs working as a seperate form and the only thing that is missing is closing the forms (i.e. the menus) by clicking outside of them.

I had hoped there was a handy function I could use with a MouseDown event that would identify if the event was occurring inside or outside the form. Otherwise I will have to rethink the interface. And after putting the time in to get it working as is I'd rather not do that if I can avoid it!
 
i cant manage to do this

i tried using the form lost focus event -

buit it wont let you close the from with this event, becuase an event is being processed (ie the lost focus event!), and i get a run time error

can anyone improve on this?


----------
note - the form "lost focus" event definitely knows you have activated some other component ...
 
If you are really set on doing this then in the Lost Focus event instead of trying to close it like GTH set the timer for 100.

Then in the forms Timer close this form.
 
Or you may be able to do it as a control/subfrom and unhide/hide it.
 
Hi all,

thanks for the replies. Decided not to bother in the end. It was a nice idea, but I'd end up spending far too long trying to implement it. I've decided to just create the menus as a set of hidden buttons - so when you click on File a row of buttons appears beneath it with the New, Edit, Close etc on it. Looks just as well IMO.

Thanks for the help though!
John.
 
not quite the same, but i have a client who doesnt like the red x close button, and wants a BIG close button.

I have a button with cli8ck event set to =genericclose()

and in a module

function genericclose
with screen.activeform
docmd.close
end with
end function


surprisingly, its quite useful - I can see how its easier to use than pinpointing the forms close spot
 

Users who are viewing this thread

Back
Top Bottom