Message overlay on form

nineclicks

Member
Joined
Jun 13, 2013
Messages
18
Programming Experience
Beginner
My Windows Form has lots of split containers and listviews and stuff. I would like to have non-interrupting alerts popup on my form. Like a messagebox without interrupting the user's input of text or clicking. Then have it disappear by itself, preferably a fade effect. I plan on having a status bar but I need something that can't be overlooked as easily.

I don't really know where to begin with having all of these splitcontainers on my form. It would be good if the overlay was purely graphic and did not "get in the way" of clicks other than visually. The graphic would pretty much just be largish text and maybe an icon.

I don't have much to go off of, I don't have any clue where to begin. Mainly because I want to make sure I do this the best way. How would I go about drawing over any object that might be under the area that the message appears?

Thanks
 
The best way would be to not draw on the form. Lots of applications use notifications and the two most common methods are a tool tip on a notification icon or a "toast" window, i.e. a window that slides up from the system try and then slides back down again or some variation on that theme. The first option just involves a regular old NotificationIcon component while the second would involve an animated (slide or fade) form. There may even be some dedicated functionality built into Windows 8 for toast notifications because Outlook displays a toast window that slides in from near the top, right of the main monitor, which is the same as Modern UI apps do. If you don't want to limit yourself to Windows 8 then you might find this useful:

Animated Window Effects with "Toast" popup demo

If you're determined to stick with your original idea then you might want to look at this:

Draw Common "Picture" on All Controls

Just be aware that some controls will not display anything drawn in their Paint event handler on part or all of there surface so there may well be breaks in your text.
 
Wow! I wasn't aware of the ShowWithoutActivation property myself. I wrote that toast demo in VB.NET 2003 against .NET 1.1 and it didn't exist back then, but I've never caught wind of it since either. I might redo that demo with that in mind.
 

Latest posts

Back
Top