Unclickable Buttons
Unclickable Buttons
You know how some buttons are unclickable and are grayed out until you open something? Then the button becomes clickable and an event happens. How can I make my button unclickable until a user opens a file in an OpenFileDialog?
- NotZachary82
- Posts: 644
- Joined: Sun Oct 28, 2007 9:15 am
- Location: TX, USA
Enabled = false
Set that in the properties of the button.
Then you can try this:
Set that in the properties of the button.
Then you can try this:
Code: Select all
C#
OpenFileDialog ofd = new OpenFileDialog();
if (ofd.ShowDialog() == DialogResult.OK)
{
button1.Enabled = true;
}