如何删除section
目前想实现这样一个功能,文章分为多个章节,每个章节占有那些section我是可以获取到比如第一章 1-3个section
第二章 4-7 section
。。。。
现在想删除第二章4-7的section
请问如何实现。 回复 1楼ninja_aya的帖子
移除 Section 的方法如下,删除特定Section 需要略微修改:
private void RemoveAllSections()
{
TXTextControl.SectionCollection.SectionEnumerator sectionEnum = textControl1.Sections.GetEnumerator();
int sectionCounter = textControl1.Sections.Count;
sectionEnum.Reset();
sectionEnum.MoveNext();
for (int i = 0; i < sectionCounter; i++)
{
TXTextControl.Section curSection = (TXTextControl.Section)sectionEnum.Current;
if (curSection.Number == 1)
{
sectionEnum.MoveNext();
continue;
}
textControl1.Selection.Start = curSection.Start - 2;
textControl1.Selection.Length = 1;
textControl1.Selection.Text = "";
}
}
回复 1楼ninja_aya的帖子
为了给你提供更优质的服务,请对本次服务进行评分。我们会认真对待你提出的宝贵意见,谢谢
http://gcdn.gcpowertools.com.cn/attachment.aspx?attachmentid=10062
页:
[1]