本文整理汇总了C#中System.Windows.Forms.DataGridViewCellStyle.Clone方法的典型用法代码示例。如果您正苦于以下问题:C# DataGridViewCellStyle.Clone方法的具体用法?C# DataGridViewCellStyle.Clone怎么用?C# DataGridViewCellStyle.Clone使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.DataGridViewCellStyle
的用法示例。
在下文中一共展示了DataGridViewCellStyle.Clone方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MainForm
public MainForm()
{
InitializeComponent();
_lightStyle = this.fieldDataGridViewTextBoxColumn.DefaultCellStyle;
_darkStyle = _lightStyle.Clone();
_darkStyle.BackColor = SystemColors.Info;
_darkStyle.SelectionBackColor = SystemColors.Info;
_readOnlyStyle = new DataGridViewCellStyle(fieldsDataGridView.DefaultCellStyle);
_editStyle = _readOnlyStyle.Clone();
_readOnlyStyle.BackColor = SystemColors.ControlLightLight;
_editStyle.BackColor = SystemColors.Window;
_lightStyle.Alignment = DataGridViewContentAlignment.MiddleLeft;
_darkStyle.Alignment = DataGridViewContentAlignment.MiddleLeft;
_editStyle.Alignment = DataGridViewContentAlignment.MiddleLeft;
_readOnlyStyle.Alignment = DataGridViewContentAlignment.MiddleLeft;
clientListDataGridView.CellMouseDown += new DataGridViewCellMouseEventHandler(RecordCurrentClientOnHeaderMouseDown);
}
示例2: DataGridView
public DataGridView ()
{
SetStyle (ControlStyles.Opaque, true);
//SetStyle (ControlStyles.UserMouse, true);
SetStyle (ControlStyles.OptimizedDoubleBuffer, true);
adjustedTopLeftHeaderBorderStyle = new DataGridViewAdvancedBorderStyle();
adjustedTopLeftHeaderBorderStyle.All = DataGridViewAdvancedCellBorderStyle.Single;
advancedCellBorderStyle = new DataGridViewAdvancedBorderStyle();
advancedCellBorderStyle.All = DataGridViewAdvancedCellBorderStyle.Single;
advancedColumnHeadersBorderStyle = new DataGridViewAdvancedBorderStyle();
advancedColumnHeadersBorderStyle.All = DataGridViewAdvancedCellBorderStyle.Single;
advancedRowHeadersBorderStyle = new DataGridViewAdvancedBorderStyle();
advancedRowHeadersBorderStyle.All = DataGridViewAdvancedCellBorderStyle.Single;
alternatingRowsDefaultCellStyle = new DataGridViewCellStyle();
allowUserToAddRows = true;
allowUserToDeleteRows = true;
allowUserToOrderColumns = false;
allowUserToResizeColumns = true;
allowUserToResizeRows = true;
autoGenerateColumns = true;
autoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.None;
autoSizeRowsMode = DataGridViewAutoSizeRowsMode.None;
backColor = Control.DefaultBackColor;
backgroundColor = SystemColors.AppWorkspace;
borderStyle = BorderStyle.FixedSingle;
cellBorderStyle = DataGridViewCellBorderStyle.Single;
clipboardCopyMode = DataGridViewClipboardCopyMode.EnableWithAutoHeaderText;
columnHeadersBorderStyle = DataGridViewHeaderBorderStyle.Single;
columnHeadersDefaultCellStyle = new DataGridViewCellStyle();
columnHeadersDefaultCellStyle.BackColor = SystemColors.Control;
columnHeadersDefaultCellStyle.ForeColor = SystemColors.WindowText;
columnHeadersDefaultCellStyle.SelectionBackColor = SystemColors.Highlight;
columnHeadersDefaultCellStyle.SelectionForeColor = SystemColors.HighlightText;
columnHeadersDefaultCellStyle.Font = this.Font;
columnHeadersDefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleLeft;
columnHeadersDefaultCellStyle.WrapMode = DataGridViewTriState.True;
columnHeadersHeight = 23;
columnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing;
columnHeadersVisible = true;
columns = CreateColumnsInstance();
columns.CollectionChanged += OnColumnCollectionChanged;
currentCellAddress = new Point (-1, -1);
dataMember = String.Empty;
defaultCellStyle = new DataGridViewCellStyle();
defaultCellStyle.BackColor = SystemColors.Window;
defaultCellStyle.ForeColor = SystemColors.ControlText;
defaultCellStyle.SelectionBackColor = SystemColors.Highlight;
defaultCellStyle.SelectionForeColor = SystemColors.HighlightText;
defaultCellStyle.Font = this.Font;
defaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleLeft;
defaultCellStyle.WrapMode = DataGridViewTriState.False;
editMode = DataGridViewEditMode.EditOnKeystrokeOrF2;
firstDisplayedScrollingColumnHiddenWidth = 0;
isCurrentCellDirty = false;
multiSelect = true;
readOnly = false;
rowHeadersBorderStyle = DataGridViewHeaderBorderStyle.Single;
rowHeadersDefaultCellStyle = (DataGridViewCellStyle) columnHeadersDefaultCellStyle.Clone ();
rowHeadersVisible = true;
rowHeadersWidth = 41;
rowHeadersWidthSizeMode = DataGridViewRowHeadersWidthSizeMode.EnableResizing;
rows = CreateRowsInstance();
rowsDefaultCellStyle = new DataGridViewCellStyle();
selectionMode = DataGridViewSelectionMode.RowHeaderSelect;
showCellErrors = true;
showEditingIcon = true;
scrollBars = ScrollBars.Both;
userSetCursor = Cursor.Current;
virtualMode = false;
horizontalScrollBar = new HScrollBar();
horizontalScrollBar.Scroll += OnHScrollBarScroll;
horizontalScrollBar.Visible = false;
verticalScrollBar = new VScrollBar();
verticalScrollBar.Scroll += OnVScrollBarScroll;
verticalScrollBar.Visible = false;
Controls.AddRange (new Control[] {horizontalScrollBar, verticalScrollBar});
}
示例3: itemDicParpadeo
public itemDicParpadeo(DataGridViewCellStyle style, PictureBox p)
{
this.estilo = style.Clone();
this.picBox = p;
}