翻譯|行業(yè)資訊|編輯:龔雪|2024-04-11 10:28:51.050|閱讀 108 次
概述:本文主要介紹界面控件DevExpress WinForms/WPF v23.2的Word Processing Document API、富文本編輯器支持內(nèi)容控件,歡迎下載最新版體驗!
# 界面/圖表報表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
眾所周知內(nèi)容控件是交互式UI元素(文本字段、下拉列表、日期選擇器),用于在屏幕上輸入和管理信息。內(nèi)容控件通常在模板/表單中使用,以標準化文檔格式和簡化數(shù)據(jù)輸入。DevExpress文字處理產(chǎn)品庫(Word Processing Document API、WinForm和WPF富文本編輯器)附帶了內(nèi)容控制支持(v23.2+)。具有內(nèi)容控件的文檔可以處理、打印或導出為PDF,本文將描述您可以使用的實現(xiàn)選項。
DevExpress WPF擁有120+個控件和庫,將幫助您交付滿足甚至超出企業(yè)需求的高性能業(yè)務(wù)應(yīng)用程序。通過DevExpress WPF能創(chuàng)建有著強大互動功能的XAML基礎(chǔ)應(yīng)用程序,這些應(yīng)用程序?qū)W⒂诋敶?戶的需求和構(gòu)建未來新一代支持觸摸的解決方案。
DevExpress WinForm擁有180+組件和UI庫,能為Windows Forms平臺創(chuàng)建具有影響力的業(yè)務(wù)解決方案。DevExpress WinForm能完美構(gòu)建流暢、美觀且易于使用的應(yīng)用程序,無論是Office風格的界面,還是分析處理大批量的業(yè)務(wù)數(shù)據(jù),它都能輕松勝任!
DevExpress技術(shù)交流群9:909157416 歡迎一起進群討論
內(nèi)容控件包括以下內(nèi)容:
在DevExpress內(nèi)容控件API (v23.2+中提供)的幫助下,您可以在文檔中創(chuàng)建、編輯和刪除內(nèi)容控件。使用 屬性作為入口點,下面的代碼片段生成純文本、下拉列表和日期選擇器內(nèi)容控件:
using DevExpress.XtraRichEdit; using DevExpress.XtraRichEdit.API.Native; using (var wordProcessor = new RichEditDocumentServer()) { Document document = wordProcessor.Document; var contentControls = document.ContentControls; // Insert a form to enter name values: var namePosition = document.CreatePosition(document.Paragraphs[0].Range.End.ToInt() - 1); var nameControl = contentControls.InsertPlainTextControl(namePosition); // Insert text: var nameTextPosition = document.CreatePosition(nameControl.Range.Start.ToInt() + 1); document.InsertText(nameTextPosition, "Click to enter a name"); // Insert an appointment type drop-down list: var listPosition = document.CreatePosition(document.Paragraphs[1].Range.End.ToInt() - 1); var listControl = contentControls.InsertDropDownListControl(listPosition); // Add items to a drop-down list: listControl.AddItem("First Appointment", "First Appointment"); listControl.AddItem("Follow-Up Appointment", "Follow-Up Appointment"); listControl.AddItem("Laboratory Results Check", "Laboratory Results Check"); listControl.SelectedItemIndex = 1; // Insert a date picker to specify appointment date: var datePosition = document.CreatePosition(document.Paragraphs[2].Range.End.ToInt() - 1); var datePicker = contentControls.InsertDatePickerControl(datePosition); datePicker.DateFormat = "dddd, MMMM dd, yyyy"; }
DevExpress富文本編輯器(WinForms和WPF)可以顯示內(nèi)容控件,您還可以根據(jù)需要輸入和選擇數(shù)據(jù)。
請注意:目前DevExpress富文本編輯器不附帶內(nèi)容控件相關(guān)的UI元素(工具欄項、對話框)。
本站文章除注明轉(zhuǎn)載外,均為本站原創(chuàng)或翻譯。歡迎任何形式的轉(zhuǎn)載,但請務(wù)必注明出處、不得修改原文相關(guān)鏈接,如果存在內(nèi)容上的異議請郵件反饋至chenjj@fc6vip.cn
文章轉(zhuǎn)載自:慧都網(wǎng)