ListView.Activation Property

Definition

获取或设置用户激活某个项必须要执行的操作的类型。Gets or sets the type of action the user must take to activate an item.

public:
 property System::Windows::Forms::ItemActivation Activation { System::Windows::Forms::ItemActivation get(); void set(System::Windows::Forms::ItemActivation value); };
public System.Windows.Forms.ItemActivation Activation { get; set; }
member this.Activation : System.Windows.Forms.ItemActivation with get, set
Public Property Activation As ItemActivation

Property Value

ItemActivation

ItemActivation 值之一。One of the ItemActivation values. 默认为 StandardThe default is Standard.

Exceptions

指定的值不是 ItemActivation 成员之一。The value specified is not one of the ItemActivation members.

Remarks

Activation 属性允许您指定用户将如何激活 ListView 控件中的项。The Activation property allows you to specify how the user will activate an item in the ListView control. ListView 中激活项不同于只选择项。Activating an item in a ListView differs from just selecting an item. 激活项后,通常会在 ItemActivate 事件的事件处理程序中执行操作。When an item is activated, an action is typically performed in an event handler for the ItemActivate event. 例如,当激活某项时,您可能会打开一个文件或显示允许编辑该项的对话框。For example, when an item is activated you might open a file or display a dialog box that allows the item to be edited. 通常,用户可通过双击项来激活该项。Typically, an item is double-clicked by the user to activate it. 如果 Activation 属性设置为 OneClick,则单击该项一次会激活它。If the Activation property is set to OneClick, clicking the item one time activates it. Activation 属性设置为 TwoClick 不同于标准双击,因为这两次单击之间的时间间隔可能会很长。Setting the Activation property to TwoClick differs from the standard double-click because the two clicks can have any duration between them.

Note

如果 Activation 属性设置为 OneClickTwoClick,则不会允许标签编辑,而与 LabelEdit 属性的值无关。If the Activation property is set to OneClick or TwoClick, label editing will not be allowed regardless of the value of the LabelEdit property.

Applies to

See also