I try to Designate the Accept Button property
from my form to the click event
of a label
. If I would have used a button this wouldn't have been a problem but I have chosen to use a label for UI reasons.
Unfortunaly the Accept Button property
only accept a button
, so I have already tried to place a button
on my form, make this button the acceptbutton
and call the label_Click
method when the button click_event is fired.
This worked like a charm but when I made the visibility property of my button false or made my button Hide()
after the InitializeComponent()
the Accept Button didn't worked anymore.
How Can the Accept Button property
accept a label OR how can I visually hide a button without changing its visibility property?
Edit: a visualisation of what I tried to acomplish.
When the enter is pressed on the form (Accept Button property
), I want to invoke the same method when the Play label is clicked.