# C1.Win.TouchToolKit.DataGridViewZoomPolicy.ZoomCellStyleFont

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Win_TouchToolKit_DataGridViewZoomPolicy_ZoomCellStyleFont_" data-uid="C1.Win.TouchToolKit.DataGridViewZoomPolicy.ZoomCellStyleFont*">ZoomCellStyleFont Property
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Win_TouchToolKit_DataGridViewZoomPolicy_ZoomCellStyleFont_" data-uid="C1.Win.TouchToolKit.DataGridViewZoomPolicy.ZoomCellStyleFont*"></a>
<h4 id="C1_Win_TouchToolKit_DataGridViewZoomPolicy_ZoomCellStyleFont" data-uid="C1.Win.TouchToolKit.DataGridViewZoomPolicy.ZoomCellStyleFont">ZoomCellStyleFont</h4>
<div class="markdown level1 summary"><p>Gets or sets a value indicating whether zoom cell style's font.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public bool ZoomCellStyleFont { get; set; }</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Property ZoomCellStyleFont As Boolean</code></pre>
</div>
<h5 class="propertyValue">Property Value</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><p><a href="https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool">true</a> if  zoom cell style's font; otherwise, <a href="https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool">false</a>. Default is <a href="https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool">true</a>.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_Win_TouchToolKit_DataGridViewZoomPolicy_ZoomCellStyleFont_remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>
If set this property to <a href="https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool">true</a>, the <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.forms.datagridview">DataGridView</a>'s
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.forms.datagridview.alternatingrowsdefaultcellstyle">AlternatingRowsDefaultCellStyle</a>,
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.forms.datagridview.alternatingrowsdefaultcellstyle">AlternatingRowsDefaultCellStyle</a>,
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.forms.datagridview.columnheadersdefaultcellstyle">ColumnHeadersDefaultCellStyle</a>,
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.forms.datagridview.defaultcellstyle">DefaultCellStyle</a>,
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.forms.datagridview.rowheadersdefaultcellstyle">RowHeadersDefaultCellStyle</a>,
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.forms.datagridview.rowsdefaultcellstyle">RowsDefaultCellStyle</a> properties' font property will be changed.
And all row/column/cell's font will be changed.
</p>
<p>
If you need to solve performance problem. see <a class="xref" href="C1.Win.TouchToolKit.DataGridViewZoomPolicy.html">DataGridViewZoomPolicy</a>.
</p>
</div>
<h5 id="C1_Win_TouchToolKit_DataGridViewZoomPolicy_ZoomCellStyleFont_examples">Examples</h5>
<p>
  The following code example shows how to use this property. 
</p>
<p>
  This code example is part of a larger example provided for the <a class="xref" href="C1.Win.TouchToolKit.DataGridViewZoomPolicy.html">DataGridViewZoomPolicy</a> class.
</p>
<pre><code class="lang-csharp">public class DataGridViewZoomPolicyDemo : Form
{
	private DataGridView _dataGridView;
	private CheckBox _fontCheckBox;
	private GcZoom _gcZoom1 = new GcZoom();
	private DataGridViewZoomPolicy _zoomPolicy = new DataGridViewZoomPolicy();

	public DataGridViewZoomPolicyDemo()
	{
		InitializeComponent();

		// DataGridView control should to change default font
		_dataGridView.ColumnHeadersDefaultCellStyle.Font = new Font(this.Font.FontFamily, this.Font.Size);
		_dataGridView.RowsDefaultCellStyle.Font = new Font(this.Font.FontFamily, this.Font.Size);

		_gcZoom1.Target = this;

		// Set DataGridView's ZoomPolicy object
		_gcZoom1.ZoomPolicies.Add(_zoomPolicy);

		_fontCheckBox.CheckedChanged += _fontCheckBox_CheckedChanged;
	}

	void _fontCheckBox_CheckedChanged(object sender, EventArgs e)
	{
		_gcZoom1.ZoomFactor = 1f;
		_zoomPolicy.ZoomCellStyleFont = _fontCheckBox.Checked;
	}

	private void InitializeComponent()
	{
		_dataGridView = new DataGridView();
		_dataGridView.Location = new Point(20, 20);
		_dataGridView.Size = new Size(400, 500);

		DataGridViewColumn column1 = new DataGridViewColumn();
		column1.CellTemplate = new DataGridViewTextBoxCell();
		column1.HeaderText = "Column 1";
		_dataGridView.Columns.Add(column1);

		DataGridViewColumn column2 = new DataGridViewColumn();
		column2.CellTemplate = new DataGridViewTextBoxCell();
		column2.HeaderText = "Column 2";
		_dataGridView.Columns.Add(column2);

		DataGridViewColumn column3 = new DataGridViewColumn();
		column3.CellTemplate = new DataGridViewTextBoxCell();
		column3.HeaderText = "Column 3";
		_dataGridView.Columns.Add(column3);

		_fontCheckBox = new CheckBox();
		_fontCheckBox.Text = "ZoomCellStyleFont";
		_fontCheckBox.Size = new Size(120, 20);
		_fontCheckBox.Location = new Point(450, 50);
		_fontCheckBox.Checked = true;

		this.Controls.Add(_dataGridView);
		this.Controls.Add(_fontCheckBox);
	}
}</code></pre>
<pre><code class="lang-csharp">Public Class DataGridViewZoomPolicyDemo
	Inherits Form
	Private _dataGridView As DataGridView
	Private _fontCheckBox As CheckBox
	Private _gcZoom1 As New GcZoom()
	Private _zoomPolicy As New DataGridViewZoomPolicy()

	Public Sub New()
		InitializeComponent()

		' DataGridView control should to change default font
		_dataGridView.ColumnHeadersDefaultCellStyle.Font = New Font(Me.Font.FontFamily, Me.Font.Size)
		_dataGridView.RowsDefaultCellStyle.Font = New Font(Me.Font.FontFamily, Me.Font.Size)

		_gcZoom1.Target = Me

		' Set DataGridView's ZoomPolicy object
		_gcZoom1.ZoomPolicies.Add(_zoomPolicy)

		AddHandler _fontCheckBox.CheckedChanged, AddressOf _fontCheckBox_CheckedChanged
	End Sub

	Private Sub _fontCheckBox_CheckedChanged(sender As Object, e As EventArgs)
		_gcZoom1.ZoomFactor = 1.0F
		_zoomPolicy.ZoomCellStyleFont = _fontCheckBox.Checked
	End Sub

	Private Sub InitializeComponent()
		_dataGridView = New DataGridView()
		_dataGridView.Location = New Point(20, 20)
		_dataGridView.Size = New Size(400, 500)

		Dim column1 As New DataGridViewColumn()
		column1.CellTemplate = New DataGridViewTextBoxCell()
		column1.HeaderText = "Column 1"
		_dataGridView.Columns.Add(column1)

		Dim column2 As New DataGridViewColumn()
		column2.CellTemplate = New DataGridViewTextBoxCell()
		column2.HeaderText = "Column 2"
		_dataGridView.Columns.Add(column2)

		Dim column3 As New DataGridViewColumn()
		column3.CellTemplate = New DataGridViewTextBoxCell()
		column3.HeaderText = "Column 3"
		_dataGridView.Columns.Add(column3)

		_fontCheckBox = New CheckBox()
		_fontCheckBox.Text = "ZoomCellStyleFont"
		_fontCheckBox.Size = New Size(120, 20)
		_fontCheckBox.Location = New Point(450, 50)
		_fontCheckBox.Checked = True

		Me.Controls.Add(_dataGridView)
		Me.Controls.Add(_fontCheckBox)
	End Sub
End Class</code></pre>

</div>
