本文整理汇总了C#中System.Windows.Forms.ListViewItem.Position属性的典型用法代码示例。如果您正苦于以下问题:C# ListViewItem.Position属性的具体用法?C# ListViewItem.Position怎么用?C# ListViewItem.Position使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类System.Windows.Forms.ListViewItem
的用法示例。
在下文中一共展示了ListViewItem.Position属性的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InitializePositionedListViewItems
private ListView positionListView;
private ListViewItem moveItem;
private Button button1;
private void InitializePositionedListViewItems()
{
// Set some basic properties on the ListView and button.
positionListView = new ListView();
positionListView.Height = 200;
button1 = new Button();
button1.Location = new Point(160, 30);
button1.AutoSize = true;
button1.Text = "Click to reposition";
button1.Click += new System.EventHandler(button1_Click);
// View must be set to icon view to use the Position property.
positionListView.View = View.LargeIcon;
// Create the items and add them to the ListView.
ListViewItem item1 = new ListViewItem("Click");
ListViewItem item2 = new ListViewItem("OK");
moveItem = new ListViewItem("Move");
positionListView.Items.AddRange(new ListViewItem[]
{ item1, item2, moveItem });
// Add the controls to the form.
this.Controls.Add(positionListView);
this.Controls.Add(button1);
}
private void button1_Click(object sender, EventArgs e)
{
moveItem.Position = new Point(30, 30);
}