Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1302
  • Last Modified:

How to insert animated gif in Toolstrip vb.net


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

How can i do that ?
1 Solution
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
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

team2005Author Commented:

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now