diff --git a/PROMS/VEPROMS User Interface/frmSectionProperties.cs b/PROMS/VEPROMS User Interface/frmSectionProperties.cs index 9e0eb497..24a6d76d 100644 --- a/PROMS/VEPROMS User Interface/frmSectionProperties.cs +++ b/PROMS/VEPROMS User Interface/frmSectionProperties.cs @@ -384,11 +384,17 @@ namespace VEPROMS if ((pf.FormatData.PurchaseOptions & E_PurchaseOptions.AutoTableOfContents) == E_PurchaseOptions.AutoTableOfContents && _SectionConfig.MySection.MyContent.Text.ToUpper() != "TABLE OF CONTENTS") { ppCbIncTOC.Enabled = true; - if (_SectionConfig.MySection.MySectionInfo.MyDocStyle.IncludeInTOC) - ppCbIncTOC.Text = "Exclude from Table of Contents"; - else - ppCbIncTOC.Text = "Include in Table of Contents"; ppCbIncTOC.Checked = _SectionConfig.Section_TOC == "Y"; + if (_SectionConfig.MySection.MySectionInfo.MyDocStyle.IncludeInTOC) + { + ppCbIncTOC.Text = "Exclude from Table of Contents"; + gpTOC.Visible = !ppCbIncTOC.Checked; // show grouping box if including on auto TOC + } + else + { + ppCbIncTOC.Text = "Include in Table of Contents"; + gpTOC.Visible = ppCbIncTOC.Checked; // show grouping box if including on auto TOC + } } if (!_SectionConfig.MySection.MySectionInfo.IsStepSection) cbKeepWordDocMargins.Checked = _SectionConfig.Section_WordMargin == "Y"; @@ -1104,7 +1110,7 @@ namespace VEPROMS } private void ppCbIncTOC_CheckedChanged(object sender, EventArgs e) { - bool isInToc = ppCbIncTOC.Checked; + bool isInToc = (_SectionConfig.MySection.MySectionInfo.MyDocStyle.IncludeInTOC) ? !ppCbIncTOC.Checked : ppCbIncTOC.Checked; if (!_Initializing) _SectionConfig.Section_TOC = isInToc ? "Y" : "N"; gpTOC.Visible = isInToc;