The following code example uses the DataGridView.DefaultCellStyle property to set these styles for the entire control. Set the SelectionForeColor and SelectionBackColor properties of a DataGridViewCellStyle. To specify the foreground and background colors of selected DataGridView cells Set the ForeColor and BackColor properties of a DataGridViewCellStyle. To specify the foreground and background colors of DataGridView cells The following code example uses the DataGridView.DefaultCellStyle property to set the font for the entire control. Set the Font property of a DataGridViewCellStyle. To specify the font used by DataGridView cells Also see How to: Set Default Cell Styles and Data Formats for the Windows Forms DataGridView Control Using the Designer. There is extensive support for this task in Visual Studio. For information about additional uses of the DataGridViewCellStyle class, see the topics listed in the See Also section. For an example of style inheritance, see How to: Set Default Cell Styles for the Windows Forms DataGridView Control. Every cell in the control inherits the styles specified through this property unless they are overridden at the column, row, or cell level. The following procedures demonstrate basic customization of cell appearance using the DefaultCellStyle property. You can retrieve instances of this class from various properties of the DataGridView class and its companion classes, or you can instantiate DataGridViewCellStyle objects for assignment to these properties. You can specify the visual appearance of cells within a DataGridView control by setting properties of the DataGridViewCellStyle class.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |