Thursday, May 29, 2014

Button Click From "If" Statement

Hi guys,


I'm writing a "dashboard" kind of program where it will scan the computer's registry for certain keys from another program of mine. I have it setup so that when the user clicks a button, it scans the registry for the keys i specify, and if they exist, the program will pop-up on a list along with a "launch" button. My problem is that once the scan is complete, through an if statement, i want the user to be able to click that launch button to launch a specific file path. However, i can't figure out how to have the user be able to click the button inside the if statement code block. Here is some of my code.



private void TBSettingsAppCheck_Click(object sender, EventArgs e)
{
//Checks for Aspire Binary Converter:
RegistryKey rk = Registry.CurrentUser.OpenSubKey("Eclipsed SuperNova\\Aspire Binary Converter");

if (rk != null)
{
RegistryKey abcPath = Registry.CurrentUser.OpenSubKey("Eclipsed SuperNova\\Aspire Binary Converter");
string abcReg = (string)abcPath.GetValue("ABCKey");
Software1.Text = "Aspire Binary Converter";
groupBox1.Visible = true;
}
else
{
MessageBox.Show("Aspire Core did not find any other Aspire software installed on this computer.");
}

}



If you can help, it will be greatly appreciated. Thanks, William




Whutchison


No comments:

Post a Comment