Skip to content

Commit 18ea4a6

Browse files
Modified the code snippet
1 parent 016320c commit 18ea4a6

File tree

1 file changed

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

1 file changed

+4
-4
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222
// Gets the last paragraph.
2323
WParagraph paragraph = document.LastParagraph;
2424
// Add text to the paragraph.
25-
document.LastParagraph.AppendText("Gender:\tFemale ");
25+
paragraph.AppendText("Gender:\tFemale ");
2626
// Append checkbox content control to the paragraph for the "checked" option.
27-
IInlineContentControl checkedCheckBox = document.LastParagraph.AppendInlineContentControl(ContentControlType.CheckBox);
27+
IInlineContentControl checkedCheckBox = paragraph.AppendInlineContentControl(ContentControlType.CheckBox);
2828
// Set the checked state of the checkbox content control to display the tick symbol when selected
2929
checkedCheckBox.ContentControlProperties.CheckedState = tickState;
3030
// Set the unchecked state of the checkbox content control to display an empty box when not selected
@@ -35,9 +35,9 @@
3535
// Gets the last paragraph.
3636
paragraph = document.LastParagraph;
3737
// Add text to the paragraph.
38-
document.LastParagraph.AppendText("\tMale ");
38+
paragraph.AppendText("\tMale ");
3939
// Append checkbox content control to the paragraph for the "unchecked" option.
40-
IInlineContentControl uncheckedCheckBox = document.LastParagraph.AppendInlineContentControl(ContentControlType.CheckBox);
40+
IInlineContentControl uncheckedCheckBox = paragraph.AppendInlineContentControl(ContentControlType.CheckBox);
4141
// Set the checked and unchecked states.
4242
uncheckedCheckBox.ContentControlProperties.CheckedState = tickState;
4343
uncheckedCheckBox.ContentControlProperties.UncheckedState = unTickState;

0 commit comments

Comments
 (0)