lundi 24 juillet 2017

if statement to check checkbox visibility in C# [duplicate]

This question already has an answer here:

I am trying to write nested if statement in which first if statement will check the visibility of a check box and if it is true it will further check that if checkbox is checked. I am not sure about the syntax i am using for checking the visibility of checkbox as V.studio is not showing red for it but when executing the code, code is breaking on this line. Please suggest if am doing anything wrong here.

Exception

if (finished)
            {
                //add checkbox code here


                    if (installationPanel.chkbxLaunchApp.IsVisible == true)
                    {
                        if (installationPanel.chkbxLaunchApp.IsChecked == true)
                        {
                            windir = System.Environment.ExpandEnvironmentVariables("%windir%"); 
                            ProcessStartInfo procinfo1 = new ProcessStartInfo(); 
                            procinfo1.FileName = windir + @"\system32\cmd.exe"; 
                            procinfo1.Arguments = @"/c " + @"C:\Program Files\sep_portal.bat"; 
                        }
                    }


                app.Shutdown();
            }

Aucun commentaire:

Enregistrer un commentaire