DocumentList.DocumentActivated 事件
在 DocumentList 控件中选择文件时发生。
命名空间: Microsoft.WindowsCE.Forms
程序集: Microsoft.WindowsCE.Forms(在 Microsoft.WindowsCE.Forms.dll 中)
语法
声明
Public Event DocumentActivated As DocumentListEventHandler
用法
Dim instance As DocumentList
Dim handler As DocumentListEventHandler
AddHandler instance.DocumentActivated, handler
public event DocumentListEventHandler DocumentActivated
public:
event DocumentListEventHandler^ DocumentActivated {
void add (DocumentListEventHandler^ value);
void remove (DocumentListEventHandler^ value);
}
JScript 不支持事件。
备注
您可以处理此事件以打开所选文件。使用 Path 属性获取该文件的路径。
在用户激活与 DocumentList 控件关联的快捷菜单时不会发生此事件。
有关处理事件的更多信息,请参见 使用事件。
示例
下面的代码示例演示处理 DocumentActivated 事件的方法。此代码示例摘自一个为 DocumentList 类提供的更大的示例。
' Handle the DocumentedActivated
' event with code to open the file.
Private Sub DocList_DocumentActivated(ByVal sender As Object, _
ByVal docevent As Microsoft.WindowsCE.Forms.DocumentListEventArgs) Handles DocumentList1.DocumentActivated
StatusBar1.Text = "Activated: " & docevent.Path
' Add code to open the selected file.
End Sub
private void OnDocActivated(object obj, DocumentListEventArgs docg)
{
statusBar1.Text = "Activated: " + docg.Path;
// Add code to open the selected file.
}
权限
- 对直接调用方的完全信任。此成员不能由部分信任的代码使用。有关更多信息,请参见通过部分受信任的代码使用库。
平台
Windows Mobile for Pocket PC
.NET Framework 和 .NET Compact Framework 并不是对每个平台的所有版本都提供支持。有关支持的版本的列表,请参见.NET Framework 系统要求。
版本信息
.NET Compact Framework
受以下版本支持:3.5、2.0