Solved

Help with creating notification control

Posted on 2015-02-11
2
65 Views
Last Modified: 2015-02-12
Hi,

How do you create a blinking control to let the user know the application is processing using VB.NET?

Thanks,

Victor
0
Comment
Question by:vcharles
2 Comments
 
LVL 40

Accepted Solution

by:
Jacques Bourgeois (James Burger) earned 500 total points
ID: 40604968
You work with a Timer.

Drag a Timer from the Toolbox to your form. It will appear in a bar at the bottom of your form.

Click on the Timer and set its Interval property to the delay that you want for you flashing. The Interval is in milliseconds, so 500 would give you half a second.

Double click on your timer to go into its Tick event, and add code such as the following. The Control can be anything, I sometimes use a Label with some meaningful text such as "Wait, I work..." :-) Add code like the following to switch the color:

	Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
		If Label1.BackColor = SystemColors.Control Then
			Label1.BackColor = Color.Red
		Else
			Label1.BackColor = SystemColors.Control
		End If
	End Sub

Open in new window


When you want your control to Flash, simply call the Start method on your Timer. The Stop method to stop it. If you do not hide the control between calls, make sure to set its BackColor to Control after the Stop, to make sure that it does not stay highlighted.
0
 

Author Closing Comment

by:vcharles
ID: 40606229
Thank You!
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
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…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

825 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