Showing/hiding controls based on event I have the following code in a portion of my program that hides/shows certain elements based on the status of a certain checkbox:

private void enableFolderVariableRemoval_CheckedChanged(object sender, EventArgs e)
{
    if (enableFolderVariableRemoval.Checked)
    {
        cleanFolderTextPanel.Visible = true;
        cleanTextPanel.Visible = true;
    }
    else
    {
        cleanFolderTextPanel.Visible = false;
        if (cleanFilenameTextPanel.Visible == false)
        {
            cleanTextPanel.Visible = false;
        }
    }
}


Is there a better way to handle this without a whole bunch of conditionals that set other controls to hide/show?
Not sure if there are any other constraints but here is one possible solution:

private void enableFolderVariableRemoval_CheckedChanged(object sender, EventArgs e)
{
    cleanFolderTextPanel.Visible = enableFolderVariableRemoval.Checked; 
    cleanTextPanel.Visible = cleanFolderTextPanel.Visible || cleanFilenameTextPanel.Visible;        
}