Skip to content

Commit b06f832

Browse files
Modified the variable name
1 parent 3a74902 commit b06f832

File tree

1 file changed

+8
-8
lines changed
  • Content-Controls/Add-tick-mark-checkbox/Add-tick-mark-checkbox

1 file changed

+8
-8
lines changed

Content-Controls/Add-tick-mark-checkbox/Add-tick-mark-checkbox/Program.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,23 +24,23 @@
2424
// Add text to the paragraph.
2525
paragraph.AppendText("Gender:\tFemale ");
2626
// Append checkbox content control to the paragraph for the "checked" option.
27-
IInlineContentControl checkedCheckBox = paragraph.AppendInlineContentControl(ContentControlType.CheckBox);
27+
IInlineContentControl checkBox = paragraph.AppendInlineContentControl(ContentControlType.CheckBox);
2828
// Set the checked state of the checkbox content control to display the tick symbol when selected
29-
checkedCheckBox.ContentControlProperties.CheckedState = tickState;
29+
checkBox.ContentControlProperties.CheckedState = tickState;
3030
// Set the unchecked state of the checkbox content control to display an empty box when not selected
31-
checkedCheckBox.ContentControlProperties.UncheckedState = unTickState;
31+
checkBox.ContentControlProperties.UncheckedState = unTickState;
3232
// Set the initial state of the "Female" checkbox to checked
33-
checkedCheckBox.ContentControlProperties.IsChecked = true;
33+
checkBox.ContentControlProperties.IsChecked = true;
3434

3535
// Add text to the paragraph.
3636
paragraph.AppendText("\tMale ");
3737
// Append checkbox content control to the paragraph for the "unchecked" option.
38-
IInlineContentControl uncheckedCheckBox = paragraph.AppendInlineContentControl(ContentControlType.CheckBox);
38+
checkBox = paragraph.AppendInlineContentControl(ContentControlType.CheckBox);
3939
// Set the checked and unchecked states.
40-
uncheckedCheckBox.ContentControlProperties.CheckedState = tickState;
41-
uncheckedCheckBox.ContentControlProperties.UncheckedState = unTickState;
40+
checkBox.ContentControlProperties.CheckedState = tickState;
41+
checkBox.ContentControlProperties.UncheckedState = unTickState;
4242
// Set the initial state of the "Male" checkbox to unchecked
43-
uncheckedCheckBox.ContentControlProperties.IsChecked = false;
43+
checkBox.ContentControlProperties.IsChecked = false;
4444

4545
// Save the document.
4646
using (FileStream outputStream = new FileStream(Path.GetFullPath(@"Output/Result.docx"), FileMode.OpenOrCreate, FileAccess.ReadWrite))

0 commit comments

Comments
 (0)