WPF 中是否有一些属性可以添加到元素中,所以当我单击它时,目标控件会获得焦点?我找到的最接近的东西是“目标”,但它只适用于访问键并且单击它没有效果。
alex2k8
问问题
1746 次
2 回答
2
覆盖标签控件
public class LabelEx : Label
{
public LabelEx() : base() {}
protected override void OnMouseDown(System.Windows.Input.MouseButtonEventArgs e)
{
if (Target != null) Target.Focus();
base.OnMouseDown(e);
}
}
于 2010-05-27T03:14:06.257 回答
1
不,但是可以使附加行为为此工作。
于 2009-03-25T15:15:34.947 回答