How can I create a completely invisible button?

拜拜、爱过 提交于 2020-01-04 15:59:11

问题


I'm trying to create a WPF button, that is completely invisible, but still has an onclick or click event, without resorting to something like MouseDown and check the keyeventargs, etc.

I have tried setting the button's visibility to Collapsed or Hidden, which also makes the button unclickable, and therefore useless for my purposes.

Any more ideas?


回答1:


Try this :

<Button Opacity="0" />



回答2:


just make a button and set

  button.Visibility = Visibility.Hidden;

or

  button.Visibility = Visibility.Collapsed;


来源:https://stackoverflow.com/questions/14423947/how-can-i-create-a-completely-invisible-button

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!