Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 403621
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T17:14:01+00:00 2026-05-12T17:14:01+00:00

I am trying to make a notification window like Outlook uses when you receive

  • 0

I am trying to make a notification window like Outlook uses when you receive a new email. I have a modeless form for the notification window with two Label controls on it to display the notification info. To get the fade-in effect, I am p/invoking the Win32 AnimateWindow function. Everything seems to be working alright except for one thing.

When I p/invoke AnimateWindow, the text in the Label controls just appears on the Form after the animation effect is over. I would like it to gradually fade in with the rest of the Form. I suspect that it has something to do with when the Form updates its child controls. I’m thinking that the Form doesn’t tell its children to update until after the AnimateWindow call. I have tried sticking Form.Update() calls after setting the text fields for the Labels, but that doesn’t help.

Basic steps I’m taking now:

// Main form of the application.
public class MainForm : Form
{
   // The notification toast.
   protected ToastForm toast;

   // Public method called to show and update the toast.
   public void UpdateToast( string text1, string text2 )
   {
      // Create a new toast form if one does not exist yet.
      if ( this.toast == null )
      {
         this.toast = new ToastForm();
      }

      // Update the toast form's Label controls.
      // Note that this isn't exactly how it's done in my app.  There are fields safely
      // wrapping the Label controls.  I just did it this way here to be concise.
      this.toast.firstLabel.Text = text1;
      this.toast.secondLabel.Text = text2;

      // This doesn't help.
      this.toast.Update();

      // P/invoke the Win32 AnimateWindow function on the toast form.
      User32.AnimateWindow( this.toast.Handle, 750, AnimateWindowFlags.AW_ACTIVATE | AnimateWindowFlags.AW_BLEND );

      // Call Show method on the toast form.  This is needed to get the controls to
      // update at all.
      this.toast.Show( this );
   }
}

Does anyone have any suggestions to get this to work?

EDIT:
I worked out a hack. After the Label text is assigned, I set the toast’s size to 0 width and 0 height. Next I call first Show and then Hide on the toast. Then I set the toast’s size back to what it was originally. Finally, I call AnimateWindow on the toast. Yeah, it works, but it is a hack… Any better ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T17:14:01+00:00Added an answer on May 12, 2026 at 5:14 pm

    There is a great example of this on the codeproject site.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to make my main window to receive notifications when user presses a
I am trying to make a semi-realtime notification system sort of like on Facebook
I am trying to make an Outlook 2003 add-in using Visual Studio 2008 on
hey, im new to android development and trying to make my first application. What
Trying to make a make generic select control that I can dynamically add elements
Trying to make a MySQL-based application support MS SQL, I ran into the following
Trying to make a generic PL/SQL procedure to export data in specific XML format,
Trying to make a web service call to an HTTPS endpoint in my Silverlight
I'm trying to make the case for click-once and smart client development but my
I'm trying to make a data bound column invisible after data binding, because it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.