using SpeechLib; using System.Threading; private void button1_Click(object sender, EventArgs e) { if (textBox1.Text != "") { SpVoice voice = new SpVoice(); voice.Volume = 100; voice.Speak(textBox1.Text, SpeechVoiceSpeakFlags.SVSFlagsAsync); voice.WaitUntilDone(Timeout.Infinite); } else MessageBox.Show("Please enter text for speech","Text to Speech", Me...
Maintain the position of the scrollbar on postbacks: In ASP.NET 1.1 it was a pain to maintain the position of the scrollbar when doing a postback operation. This was especially true when you had a grid on the page and went to edit a specific row. Instead of staying on the desired row, the page would reload and you'd be placed back at the top and have to scroll down. In ASP.NET 2.0 you can simply add the MaintainScrollPostionOnPostBack attribute to the Page directive: MaintainScrollPositionOnPostback="true" AutoEventWireup="true" CodeFile="..." Inherits="..." % >
Set the default button that is triggered when the user hits the enter key: This was a major pain point in ASP.NET 1.1 and required some JavaScript to be written to ensure that when the user hit the enter key that the appropriate button on the form triggered a "click" event on the server-side. Fortunately, you can now use the HtmlForm control's DefaultButton property to set which button should be clicked when the user hits enter. This property is also available on the Panel control in cases where different buttons should be triggered as a user moves into different Panels on a page. ...
Comments
Post a Comment