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?
you can do like this way. yourbutton. setVisibility(Button. GONE);
To 'hide' the text on the button, simply call setText() with "" or null .
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) .
Try setting the Button's Opacity
...
<Button Opacity="0" />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With