[]
        
(Showing Draft Content)

C1.Win.TouchToolKit.ListViewZoomPolicy.ZoomItemFont

ZoomItemFont Property

ZoomItemFont

Gets or sets a value indicating whether zoom item's font.

Declaration
public bool ZoomItemFont { get; set; }
Property Value
Type Description
bool

true if zoom item's font; otherwise, false. The default is true.

Examples

The following code example shows how to use this property.

This code example is part of a larger example provided for the ListViewZoomPolicy class.

public class ListViewZoomPolicyDemo : Form
{
	private ListView _listView;
	private CheckBox _zoomItemFont;
	private ListViewZoomPolicy _listViewZoomPolicy = new ListViewZoomPolicy();
	private GcZoom _gcZoom1 = new GcZoom();

	public ListViewZoomPolicyDemo()
	{
		InitializeComponent();

		_gcZoom1.Target = this;

		// Set ListView's ZoomPolicy object
		_gcZoom1.ZoomPolicies.Add(_listViewZoomPolicy);

		// ListView control should to change default font
		foreach (ListViewItem item in _listView.Items)
		{
			item.Font = new Font(this.Font.FontFamily, this.Font.Size);
		}

		_zoomItemFont.CheckedChanged += _zoomItemFont_CheckedChanged;
	}

	void _zoomItemFont_CheckedChanged(object sender, EventArgs e)
	{
		_gcZoom1.ZoomFactor = 1f;
		_listViewZoomPolicy.ZoomItemFont = _zoomItemFont.Checked;
	}

	private void InitializeComponent()
	{
		_listView = new ListView();
		_listView.Location = new Point(20, 20);
		_listView.Size = new Size(400, 300);
		_listView.GridLines = true;

		_listView.View = View.Details;
		_listView.Columns.Add("", 100, HorizontalAlignment.Center);
		_listView.Columns.Add("", 100, HorizontalAlignment.Center);
		_listView.Columns.Add("", 100, HorizontalAlignment.Center);

		ListViewItem item1 = new ListViewItem(new string[] { "Item 1", "Item 2", "Item 3" });
		ListViewItem item2 = new ListViewItem(new string[] { "Item 4", "Item 5", "Item 6" });
		_listView.Items.Add(item1);
		_listView.Items.Add(item2);

		_zoomItemFont = new CheckBox();
		_zoomItemFont.Text = "ZoomItemFont";
		_zoomItemFont.Size = new Size(120, 20);
		_zoomItemFont.Location = new Point(450, 80);
		_zoomItemFont.Checked = true;

		this.Controls.Add(_listView);
		this.Controls.Add(_zoomItemFont);
	}
}
Public Class ListViewZoomPolicyDemo
	Inherits Form
	Private _listView As ListView
	Private _zoomItemFont As CheckBox
	Private _listViewZoomPolicy As New ListViewZoomPolicy()
	Private _gcZoom1 As New GcZoom()

	Public Sub New()
		InitializeComponent()

		_gcZoom1.Target = Me

		' Set ListView's ZoomPolicy object
		_gcZoom1.ZoomPolicies.Add(_listViewZoomPolicy)

		' ListView control should to change default font
		For Each item As ListViewItem In _listView.Items
			item.Font = New Font(Me.Font.FontFamily, Me.Font.Size)
		Next

		AddHandler _zoomItemFont.CheckedChanged, AddressOf _zoomItemFont_CheckedChanged
	End Sub

	Private Sub _zoomItemFont_CheckedChanged(sender As Object, e As EventArgs)
		_gcZoom1.ZoomFactor = 1.0F
		_listViewZoomPolicy.ZoomItemFont = _zoomItemFont.Checked
	End Sub

	Private Sub InitializeComponent()
		_listView = New ListView()
		_listView.Location = New Point(20, 20)
		_listView.Size = New Size(400, 300)
		_listView.GridLines = True

		_listView.View = View.Details
		_listView.Columns.Add("", 100, HorizontalAlignment.Center)
		_listView.Columns.Add("", 100, HorizontalAlignment.Center)
		_listView.Columns.Add("", 100, HorizontalAlignment.Center)

		Dim item1 As New ListViewItem(New String() { "Item 1", "Item 2", "Item 3"})
		Dim item2 As New ListViewItem(New String() { "Item 4", "Item 5", "Item 6"})
		_listView.Items.Add(item1)
		_listView.Items.Add(item2)

		_zoomItemFont = New CheckBox()
		_zoomItemFont.Text = "ZoomItemFont"
		_zoomItemFont.Size = New Size(120, 20)
		_zoomItemFont.Location = New Point(450, 80)
		_zoomItemFont.Checked = True

		Me.Controls.Add(_listView)
		Me.Controls.Add(_zoomItemFont)
	End Sub
End Class