COM Objects, C#, and the Microsoft Speech API
By Charles Simon, September 01, 2002
Using COM objects in C# is a snap relative to C++. In this overview of handling events from a COM object, Charles uses the Microsoft Speech API to create a sample program called BackChat that provides both speech recognition and text-to-speech functionality. He also demonstrates using a database table for nonvolatile data storage and how to access the Windows service ShellExecute() to spawn other Windows programs from a .NET program.
September 2002/COM Objects, C#, and the Microsoft Speech API
Listing 3: Setting up a DataGrid style.
DataGridTableStyle theTableStyle = new DataGridTableStyle();
theTableStyle.MappingName = "BackChat";
theColumnStyle = new DataGridTextBoxColumn();
theColumnStyle.MappingName = "Command"; //which DataSet column to use
theColumnStyle.HeaderText = "Command"; //the title at the tope of the column
theColumnStyle.Width = (myGrid.Width - 40) / 3;
theTableStyle.GridColumnStyles.Add(theColumnStyle);
// repeat to set up the other column styles
theTableStyle.AlternatingBackColor = Color.LightBlue;
myGrid.TableStyles.Add(theTableStyle);