I have an app that shows a window that I want to have a message that is a
YES/NO question.
It looks like this:
------------------------------------------------------------------------------------------------------------------------
| Can you go eat at 12:00?
[yes] [no] |
------------------------------------------------------------------------------------------------------------------------
This is a vb form with no border, positioned with top=0, left being such
that it is centered. It should be topmost to all windows.
I want the user to see it, but be able to keep working in whatever app they
are currently using without being rudely interrupted.
Of course the questions actually asked are different and business related.
Therefore the window needs to show but not be Active--i.e. not steal the
focus.
I have tried everything I can think of including showing it with
ShowWindow() API with SW_SHOWNA and other API's.
This seems to show it, but then it won't show anything in the form i.e. the
text or buttons. And it shows an hourglass as if it is hung.
To be sure that showing the form via ShowWindow wasn't hanging up the
textbox and button controls, I got rid of them and am now painting the text
to the form in the Paint event with DrawString and drawing the graphics for
yes and know, doing hit testing and such...so there are NO controls now.
This still doesn't work.
Does anyone know how to do this?
Thanks
Sorry, my fault, i meant you could use "mybase.deactivated" evant
handler:
Private Sub Form1_deactivate(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Deactivate
' put here the code when you form is deactivated by user, you can put
nothing or a msgbox that is YesNO style.