我有一个复选框一个TreeView,我想禁用双击,只有当这是在复选框完成。
I have a treeview with checkbox, I'm trying to disable the double click only when this is done in the checkbox.
我找到了一种方法来完全禁用双击,但它不是我想要的。
I found a way to totally disable the double click but it was not what I wanted.
我AP preciate,如果你能帮助我。
I appreciate if you can help me.
如果你只是想知道一个DoubleClick事件的复选框发生了:
If you just want to know a DoubleClick event occurred from the CheckBox:
private void TreeViewDoubleClick(object sender, EventArgs e)
{
var localPosition = treeView.PointToClient(Cursor.Position);
var hitTestInfo = treeView.HitTest(localPosition);
if (hitTestInfo.Location == TreeViewHitTestLocations.StateImage)
return;
// ... Do whatever other processing you want
}
上一篇:增加INotifyPropertyChanged的到模型?模型、INotifyPropertyChanged
下一篇:Assembly.GetCallingAssembly不支持WinRT的,但对于便携式类库?不支持、类库、Assembly、GetCallingAssembly