함께 작업 TextBoxes
그 안에 Aspose.Words, TextBox 클래스는 도형 안에 텍스트가 표시되는 방법을 지정하는 데 사용됩니다. 그것은 명명 된 공공 재산을 노출합니다 Parent 고객이 링크를 찾을 수 있도록 텍스트 상자의 부모 모양을 가져오려면 Shape 연관된 TextBox.
링크 만들기
그 TextBox 클래스 제공 IsValidLinkTarget 여부를 확인하기 위해 방법 TextBox 대상에 연결할 수 있습니다 Textbox.
다음 코드 예제에서는 다음과 같은 경우를 확인하는 방법을 보여 줍니다 TextBox
대상 텍스트 상자에 연결할 수 있습니다:
For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-C | |
System::SharedPtr<Document> doc = System::MakeObject<Document>(); | |
System::SharedPtr<Shape> shape1 = System::MakeObject<Shape>(doc, ShapeType::TextBox); | |
System::SharedPtr<Shape> shape2 = System::MakeObject<Shape>(doc, ShapeType::TextBox); | |
System::SharedPtr<TextBox> textBox1 = shape1->get_TextBox(); | |
System::SharedPtr<TextBox> textBox2 = shape2->get_TextBox(); | |
if (textBox1->IsValidLinkTarget(textBox2)) | |
{ | |
textBox1->set_Next(textBox2); | |
} |
확인 TextBox 순서
모양에서 텍스트를 표시하는 방법에는 여러 가지가 있습니다. 그 TextBox 시퀀스의 머리,중간 또는 꼬리가 될 수 있습니다.
다음 코드 예제에서는 다음을 확인하는 방법을 보여 줍니다 TextBox 머리,꼬리 또는 시퀀스의 중간입니다:
For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-C | |
System::SharedPtr<Document> doc = System::MakeObject<Document>(); | |
System::SharedPtr<Shape> shape = System::MakeObject<Shape>(doc, ShapeType::TextBox); | |
System::SharedPtr<TextBox> textBox = shape->get_TextBox(); | |
if ((textBox->get_Next() != nullptr) && (textBox->get_Previous() == nullptr)) | |
{ | |
std::cout << "The head of the sequence" << std::endl; | |
} | |
if ((textBox->get_Next() != nullptr) && (textBox->get_Previous() != nullptr)) | |
{ | |
std::cout << "The Middle of the sequence." << std::endl; | |
} | |
if ((textBox->get_Next() == nullptr) && (textBox->get_Previous() != nullptr)) | |
{ | |
std::cout << "The Tail of the sequence." << std::endl; | |
} |
링크 끊기
를 사용하여 BreakForwardLink 방법 당신은 다음에 대한 링크를 깰 수 있습니다 TextBox.
다음 코드 예제에서는 링크를 끊는 방법을 보여 줍니다 TextBox:
For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-C | |
System::SharedPtr<Document> doc = System::MakeObject<Document>(); | |
System::SharedPtr<Shape> shape = System::MakeObject<Shape>(doc, ShapeType::TextBox); | |
System::SharedPtr<TextBox> textBox = shape->get_TextBox(); | |
// Break a forward link | |
textBox->BreakForwardLink(); | |
// Break a forward link by setting a null | |
textBox->set_Next(nullptr); | |
// Break a link, which leads to this textbox | |
if (textBox->get_Previous() != nullptr) | |
{ | |
textBox->get_Previous()->BreakForwardLink(); | |
} |