.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal

Home >> Articles >> Windows Application >> Post New Resource Bookmark and Share   

 Subscribe to Articles

Title with Blinking Effect in Windows Form.

Posted By:shiv chandra       Posted Date: June 16, 2011    Points: 200    Category: Windows Application    URL: http://www.dotnetspark.com  

Title with blinking effect in windows form. You can learn how to use timer and Track Bar in window application.

Here I have created sample application for show effect on title of window's form. It's basically created for explain usage of Timer as well as Track Bar. Sometimes it is required to set some value based on track bar. So from here you can learn basic things.

Form can be viewed as shown in below screen shot. When you click start button, you can see blinking effect on title bar as well as in Task Bar.

Timer will raise its "Tick" event after specified "Interval". You can set interval from property of timer control. But timer control will raise its event only if timer is enabled. Bigger interval will raise event less time, as event will fire after specified interval. So if you want to do some task faster you need to decrease interval and if you want to make speed slower you need to increase interval.

Basically following five property need to be know if you want to use track bar.

  1. Maximum:        Maximum value for Track bar.
  2. Minimum:         Minimum value for Track bar.
  3. Value:               Current value of Track bar, initially you can use this to set value.
  4. LargeChange:   Number of position slider moves in response to mouse click or Page Up and Page Down keys.
  5. SmallChange: Number of position slider moves in response to keyboard's arrow key.
/// This Event will chnage title. This event will raise only if Timer is Enabled.
private void timer1_Tick(object sender, EventArgs e)
  if (txtTitle.Text.Trim() == string.Empty)
     BtnStopEffect_Click(sender, e);
     MessageBox.Show("Please Enter Text So that Effect can be visible, Then Click on Start Blinking.", "First Enter something in 'Change Form Title To:'", MessageBoxButtons.OK, MessageBoxIcon.Information);
   this.Text = this.Text !=string.Empty ? string.Empty : txtTitle.Text;

/// Change speed of blinking.
private void trackBar1_Scroll(object sender, EventArgs e)
    timer1.Interval = trackBar1.Value;            

 Subscribe to Articles


Further Readings:


No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More Articles on C#, ASP.Net, Vb.Net, SQL Server and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend