How to insert animated gif in Toolstrip

Posted on 2011-05-12
Last Modified: 2012-08-13

I want to insert a blinking gif to my Toolstrip in
Want to display this animated gif, when the system is running email function.

How can i do that ?
Question by:team2005
    LVL 10

    Expert Comment

    1) use the web browser control and drag it onto your form
    2) use the little arrow and click on Unlock in parent form option
    3) resize it appropriately, and fit it into your toolstrip menu where you want it to show
    4) set it to visible=false
    5) in the toolstrip menu item code click, set "webbrowser.navigate" to appropriate image ("reportserver.gif" if its in your project folder)
    6) set it to visible=true
    7) when code ends for sending mail, set it to visible=false

    hope this helps
    LVL 5

    Accepted Solution

    An even better way to achieve the same end (notifying the user what's going on):
    1) Add a label to the toolstrip we'll (call it "EmailLabel" in this example).

    2) Set the EmailLabel Visible property to False (so that it is not shown by default)

    3) set the text of the label appropriately, and configure the font however you like.

    4) Add a timer to the form (we'll call it "BlinkTimer" in this example)

    5) Set the Enabled property of BlinkTimer to false (so the label does not blink automatically)
    6) Set the Interval property on the timer according to your desired blink rate (note that Interval is in milliseconds. For instance, an Interval of 750 would equal .75 seconds)

    7) In the OnTick event of BlinkTimer, add this code:
    For VB .Net:
    EmailLabel.Visible = Not EmailLabel.Visible

    Open in new window

    For c#:
    EmailLabel.Visible = !EmailLabel.Visible;

    Open in new window

    8) When you want the label to start blinking, run this code:
    For VB .Net:
    BlinkTimer.Enabled = True

    Open in new window

    For c#:
    BlinkTimer.Enabled = true;

    Open in new window

    9) When you want the label to stop blinking, run this code:
    For VB.Net:
    BlinkTimer.Enabled = False
    EmailLabel.Visible = False

    Open in new window

    For c#:
    BlinkTimer.Enabled = false;
    EmailLabel.Visible = false;

    Open in new window

    LVL 2

    Author Closing Comment


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    Suggested Solutions

    Title # Comments Views Activity
    prevent lose focus 6 48
    WS_CHILD window 14 36
    Defining a Class to Select Instances 8 43
    Array Median As Double 4 15
    It’s quite interesting for me as I worked with Excel using for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
    It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now