开发者

How do I make somthing visible when the mouse moves across a button?

开发者 https://www.devze.com 2023-01-10 19:46 出处:网络
How do I show a PropertyGrid instead of a context menu, so when the user clicks somewhere else, it will hide (like a context 开发者_高级运维menu)?You could wire the loss of focus to this action. It\'s

How do I show a PropertyGrid instead of a context menu, so when the user clicks somewhere else, it will hide (like a context 开发者_高级运维menu)?


You could wire the loss of focus to this action. It's not perfect (not all clicks outside the control will be captured), but it will work every time another control grabs focus.

propertyGrid1.Leave += (object sender, EventArgs e) => { propertyGrid1.Hide(); };

If this is not good enough, you could try wiring the action to other events, such as the form's Click event.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号