Windows Phone Developers

Saturday, January 10, 2009

Beep in C# Windows forms

Alert user with beep sound for invalid entries using C#

Many times when we alert the user with some messages but the user doesn’t heed immediately. A combination of sound and popup should be more helpful. The following example would alert the user if he/she hasn’t input the required field

private void buttonOK_Click(object sender, EventArgs e)

{

if (txtExcelFile.Text.Length == 0)

{

System.Console.Beep();

MessageBox.Show ("Select the file and continue...");

}

}



Windows User Form

For a Rhyming Beep peep at http://dotnetdud.blogspot.com/2009/01/how-to-create-rhyming-beeps-in-c.html Digg Technorati Delicious StumbleUpon Reddit BlinkList Furl Mixx Facebook Google Bookmark Yahoo
ma.gnolia squidoo newsvine live netscape tailrank mister-wong blogmarks slashdot spurl StumbleUpon

No comments:

Post a Comment