Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I make an invisible, yet clickable button in C#

Tags:

I would like to be able to have a button that is not visible, but able to trigger a click event when clicked.

I'm looking at this page MSDN: System.windows.visibilty and it seems that buttons can have three visibility states. Visible, Hidden and Collapsed. When the button is Hidden or Collapsed, I can't see it (which is good) but I can't click it (which is bad).

Does anyone have a way that I can make clickable invisible element in my XAML file?

like image 299
Jeffrey Greenham Avatar asked Feb 03 '11 22:02

Jeffrey Greenham


People also ask

How do you make a button invisible after clicking?

you can do like this way. yourbutton. setVisibility(Button. GONE);

How do I make my text button invisible?

To 'hide' the text on the button, simply call setText() with "" or null .

How do you make a button invisible in Java?

To hide a button in JavaFX, setVisible(false) should be invoked on the button object to remove it from view. The button will still maintain its position and other nodes may still be arranged around it. To uncouple the button from the layout's position calculations, developers can additionally setManaged(false) .


1 Answers

Try setting the Button's Opacity...

<Button Opacity="0" /> 
like image 113
Gabe Avatar answered Oct 06 '22 00:10

Gabe