« Home « Chủ đề thủ thuật lập trình C

Chủ đề : thủ thuật lập trình C


Có 60+ tài liệu thuộc chủ đề "thủ thuật lập trình C"

Manning Windows Forms Programming (phần 13)

tailieu.vn

We will discuss the details of these style classes later in the chapter.. AlternatingBackColor Gets or sets the background color to use on every other row in the grid to create a ledger- like appearance.. CaptionText Gets or sets the text to appear in the caption area.. CurrentCell Gets or sets a DataGridCell structure representing the cell in the grid...

Manning Windows Forms Programming (phần 14)

tailieu.vn

Display the caption in the title bar.. This is the default event for this component, so simply double-click the timer in the component tray.. 20 Back in the MainForm class, add a private void menuSlideShow_Click I MPLEMENT THE SLIDE SHOW BEHAVIOR (continued). In the MyPhotos application we display photographs in a Panel control, while in our other applications we use...

Manning Windows Forms Programming (phần 15)

tailieu.vn

typeof Obtains the System.Type object for a given type. using System.Windows.Forms;. In the .NET Frame- work, all exceptions inherit from the System.Exception class. In the .NET Framework, the System.Array class serves as the base class for all array objects. Note that the Length property from the System.Array class determines the number of elements in an array, and the foreach keyword...

Netframwork 2.0 (phần 1)

tailieu.vn

Modifying the Look and Feel of the Form. You will learn how to create forms and refer to them in code, alter the visual properties of the form, and control the behavior of the form at run time.. Forms can receive user input in the form of key­. Click Add to add the form to the development environment.. Refer to...

Netframwork 2.0 (phần 2)

tailieu.vn

Drag the control from the Toolbox to the surface of the form or container control.. To add a control to a form or container control at run time, manually instantiate a new control and add it to the Controls collection of the form, as shown in the following example. Forms Controls.” Table 1-4 describes Text, the most important unique property...

Netframwork 2.0 (phần 3)

tailieu.vn

In the Property Grid, set the Text property to Open Form.. In the Properties window, set the TabIndex property as shown.. Important properties of the TextBox control are shown in Table 2-6.. Table 2-6 Important Properties of the TextBox Control. AutoCompleteMode Sets the AutoComplete mode of the control. CharacterCasing Indicates the casing of the characters in the Text- Box control....

Netframwork 2.0 (phần 5)

tailieu.vn

Object, ByVal e As _ System.EventArgs). The connection object you use is based on the type of data source your application needs to communicate with.. Configure a connection to a database using the Connection class.. Close an ADO.NET connection to a database by using the Close method of the Connection object.. Protect access to the connection details of a data...

Netframwork 2.0 (phần 6)

tailieu.vn

Table 5-7 Connection Pooling Connection String Keywords. This clears the connection pool by disposing of the connections instead of returning them to the pool when they are closed. Any connections that are already in the pool and open will be disposed of the next time they are closed. ilar to the following:. A connection string. The identity or credentials of...

Netframwork 2.0 (phần 7)

tailieu.vn

After you create a parameter, you must add it to the Parameters collection of the Command object that will execute the SQL statement or stored procedure that uses the parameter.. GetCostCommand.Parameters.Add(TotalCostParameter). GetCostCommand.Parameters.Add(TotalCostParameter);. Add a TextBox to the form and set the following properties:. Add references to the System.Data and System.Data.SqlClient namespaces.. using System.Text;. Add the following code to the ExecuteSqlButton_Click...

Netframwork 2.0 (phần 8)

tailieu.vn

List the potential improvements you can make to the application.. The following code sample shows how to add a Customers- Table and OrdersDataTable to the NorthwindDataset:. Add DataTables to the Dataset's Tables collection.. NorthwindDataset.Tables.Add(CustomersTable) NorthwindDataset.Tables.Add(OrdersDataTable). NorthwindDataset.Tables.Add(CustomersTable);. NorthwindDataset.Tables.Add(OrdersDataTable);. Add the relationship to the DataSet.. NorthwindDataset.Relations.Add(CustomersOrders). NorthwindDataset.Relations.Add(CustomersOrders);. Double-click the Get Customers button and add the following code to the GetCustomersButton_Click event handler:....

Netframwork 2.0 (phần 9)

tailieu.vn

These differing versions are accessed by passing a value from the DataRow- Version enumeration as an argument in addition to the column index when accessing the data in a row. DataTable objects expose several events that are raised when changes are being made to the data in the table.. When errors are encountered during the processing of DataRows, a value...

Netframwork 2.0 (phần 10)

tailieu.vn

To display a dataset in a DataGridView control or, more specifically, to display a Data- Table in a DataGridView, set the DataSource property of the DataGridView to the DataSet and set the DataMember property of the DataGridView to the name of the DataTable. Custom Column If none of the preceding column types provides the specific functionality you require, you can...

Netframwork 2.0 (phần 11)

tailieu.vn

Open Form1 in the Designer. Note that the book you added appears at the end of the XML file.. The XmlDocument class exposes several methods and properties that provide for the direct modification of the XML that it contains. You can write XML from the XML document to an instance of the XmlWriter class by using the XmlDocument.WriteTo method.. Answers...

Netframwork 2.0 (phần 12)

tailieu.vn

To complete a drag-and-drop operation, the drag effect specified in the DoDragDrop method must match the value of the Effect parameter of the DragEventArgs object asso­. ciated with the drag-and-drop event, which is generally set in the DragDropEnter. All Data is copied, removed from the drag source, and scrolled in the target.. Scroll Scrolling is about to start or is...

Netframwork 2.0 (phần 13)

tailieu.vn

Table 12-6 Important Methods of the HelpProvider Component. Table 12-7 describes the members of the HelpNavigator enumeration.. Table 12-7 Members of the HelpNavigator Enumeration. AssociateIndex The help file opens to the index entry for the first letter of the specified keyword.. The SoundPlayer class in the System.Media namespace encapsulates all of the functionality required to play sound files.. Create an...

Netframwork 2.0 (phần 14)

tailieu.vn

Within the bounds of the class declaration in the Code window, add the method declaration and the method body. Adding Events to a Control You can add events to a control that can be raised to notify the rest of the application that something interesting has happened. tion to the rest of the application.. In Visual Basic, you can create...

Netframwork 2.0 (phần 15)

tailieu.vn

In the right-hand pane of the File System Editor, right-click the file for which you want to create a shortcut and choose Create Shortcut. A shortcut to the file is cre­. Author Contains information about the author of the program.. Description Contains a description of the application.. Manufacturer Contains information about the manufacturer of the application.. ManufacturerURL Contains the URL...

Netframwork 2.0 (phần 16)

tailieu.vn

UseAntiAlias is a property, not a method, and it exists in the PrintPreviewControl class, not on the Document property.. UseAntiAlias exists in the PrintPreviewControl class, not on the Document property.. In the method handling the PrintPages event, you can loop through the controls on the form. For the label controls, you can use the Graphics.DrawString method to print the string...

Lập trình ứng dụng nâng cao (phần 1)

tailieu.vn

Microsoft, MSDN, the .NET logo, Visual Basic, Visual C. Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. While every precaution has been taken in the preparation of this book, the publisher and authors assume no responsibility for errors or omissions, or for damages resulting from the use of the information contained...

Lập trình ứng dụng nâng cao (phần 2)

tailieu.vn

In the C# language, spaces, tabs, and newlines are considered to be “whitespace” (so named because you see only the white of the underlying “page. Console.WriteLine("Hello World");. Most of the time, the use of whitespace is intuitive. For now, let’s consider some of the more basic methods of conditional and unconditional branching.. is invoked (invok- ing a method is also...