當前位置: 首頁>>代碼示例>>C#>>正文


C# RichTextBox.SetValue方法代碼示例

本文整理匯總了C#中System.Windows.Controls.RichTextBox.SetValue方法的典型用法代碼示例。如果您正苦於以下問題:C# RichTextBox.SetValue方法的具體用法?C# RichTextBox.SetValue怎麽用?C# RichTextBox.SetValue使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.Windows.Controls.RichTextBox的用法示例。


在下文中一共展示了RichTextBox.SetValue方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: SetIsEnabled

 public static void SetIsEnabled(RichTextBox richTextBox, bool value)
 {
     if (richTextBox == null)
     {
     throw new ArgumentNullException("richTextBox");
     }
     richTextBox.SetValue(IsEnabledProperty, value);
 }
開發者ID:unbearab1e,項目名稱:FlattyTweet,代碼行數:8,代碼來源:IntellisenseExtension.cs

示例2: CreateGrid

        private Inline CreateGrid(DocTree tree)
        {
            Grid g = new Grid();
            int rowMax = 0; int colMax = 0;
            Dictionary<int, Dictionary<int, RichTextBox>> cells = new Dictionary<int, Dictionary<int, RichTextBox>>();
            foreach (var child in tree.Children)
            {
                Span span = new Span();
                DocTreeToTextElement(child, span.Inlines);

                int row = child.Row - 1;
                int col = child.Column - 1;
                if (!cells.ContainsKey(col))
                    cells.Add(col, new Dictionary<int, RichTextBox>());
                var column = cells[col];
                if (!column.ContainsKey(row))
                {
                    var spanel = new RichTextBox()
                    {
                        BorderThickness = new Thickness(0),
                        IsReadOnly = true
                    };
                    spanel.SetValue(Grid.ColumnProperty, col);
                    spanel.SetValue(Grid.RowProperty, row);
                    column.Add(row, spanel);
                    g.Children.Add(spanel);
                }
                RichTextBox tb = column[row];
                tb.Selection.Insert(span);
                rowMax = (int)Math.Max(rowMax, child.Row);
                colMax = (int)Math.Max(colMax, child.Column);
            }
            for (int i = 0; i < rowMax; i++)
                g.RowDefinitions.Add(new RowDefinition());
            for (int i = 0; i < colMax; i++)
                g.ColumnDefinitions.Add(new ColumnDefinition());
            InlineUIContainer c = new InlineUIContainer()
            {
                Child = g
            };
            return c;
        }
開發者ID:Esri,項目名稱:arcgis-viewer-silverlight,代碼行數:42,代碼來源:HtmlTextBlock.cs

示例3: SetIgnorePrefix

 public static void SetIgnorePrefix(RichTextBox richTextBox, bool value)
 {
     if (richTextBox == null)
     {
     throw new ArgumentNullException("richTextBox");
     }
     richTextBox.SetValue(IgnorePrefixProperty, value);
 }
開發者ID:unbearab1e,項目名稱:FlattyTweet,代碼行數:8,代碼來源:IntellisenseExtension.cs

示例4: SetExcludeMentions

 public static void SetExcludeMentions(RichTextBox richTextBox, bool value)
 {
     if (richTextBox == null)
     {
     throw new ArgumentNullException("richTextBox");
     }
     richTextBox.SetValue(ExcludeMentionsProperty, value);
 }
開發者ID:unbearab1e,項目名稱:FlattyTweet,代碼行數:8,代碼來源:IntellisenseExtension.cs

示例5: SetBindableDocument

 public static void SetBindableDocument(RichTextBox obj, FlowDocument value)
 {
     obj.SetValue(BindableDocumentProperty, value);
 }
開發者ID:schuster-rainer,項目名稱:scripting-shell,代碼行數:4,代碼來源:BindableRichTextBox.cs

示例6: SetPreventTextInput

 public static void SetPreventTextInput(RichTextBox obj,
                         bool value)
 {
     obj.SetValue(PreventTextInputProperty, value);
 }
開發者ID:ArildF,項目名稱:linqtwit,代碼行數:5,代碼來源:RichTextBoxBehavior.cs

示例7: limitSkill_BindData

        private void limitSkill_BindData(LimitSkillMaster skill, ActiveSkillMaster[] laSkill)
        {
            if (skill == null || skill.id == 0) {
                UnitInfo_LimitSkill.Visibility = Visibility.Collapsed;
                return;
            }
            UnitInfo_LimitSkill.Visibility = Visibility.Visible;

            limitSkill_id.Text = skill.id.ToString();
            limitSkill_name.Text = skill.name;
            limitSkill_general_text.Document = Utility.ParseTextToDocument(skill.general_text);
            limitSkill_coefficient.Text = skill.coefficient.ToString();

            UnitInfo_LimitSkill_AS.Children.Clear();
            for (int i = 0; i < 3; i++) {
                ActiveSkillMaster askill = laSkill[i];
                Grid grid = new Grid();
                if (askill.id == 0) {
                    continue;
                }
                grid.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(50) });
                grid.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(50) });
                grid.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(50) });
                grid.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(1, GridUnitType.Star) });
                grid.RowDefinitions.Add(new RowDefinition() { Height = new GridLength(1, GridUnitType.Star) });
                grid.RowDefinitions.Add(new RowDefinition() { Height = new GridLength(1, GridUnitType.Star) });
                grid.RowDefinitions.Add(new RowDefinition() { Height = new GridLength(1, GridUnitType.Star) });
                grid.RowDefinitions.Add(new RowDefinition() { Height = new GridLength(1, GridUnitType.Star) });
                grid.RowDefinitions.Add(new RowDefinition() { Height = new GridLength(1, GridUnitType.Star) });
                grid.RowDefinitions.Add(new RowDefinition() { Height = new GridLength(1, GridUnitType.Star) });
                TextBlock tblTitle = new TextBlock() { FontWeight = FontWeights.Bold, Text = string.Format("L_AS{0}", i.ToString()) };
                tblTitle.SetValue(Grid.ColumnProperty, 0);
                tblTitle.SetValue(Grid.RowProperty, 0);
                grid.Children.Add(tblTitle);
                TextBox tbId = new TextBox() { Text = askill.id.ToString() };
                tbId.SetValue(Grid.ColumnProperty, 1);
                tbId.SetValue(Grid.RowProperty, 0);
                grid.Children.Add(tbId);
                TextBox tbName = new TextBox() { Text = askill.name };
                tbName.SetValue(Grid.ColumnProperty, 2);
                tbName.SetValue(Grid.RowProperty, 0);
                tbName.SetValue(Grid.ColumnSpanProperty, 2);
                grid.Children.Add(tbName);
                RichTextBox rtb = new RichTextBox() { Document = Utility.ParseTextToDocument(askill.text) };
                rtb.SetValue(Grid.ColumnProperty, 0);
                rtb.SetValue(Grid.RowProperty, 1);
                rtb.SetValue(Grid.ColumnSpanProperty, 4);
                grid.Children.Add(rtb);
                TextBlock tblType = new TextBlock() { Text = "type" };
                tblType.SetValue(Grid.ColumnProperty, 0);
                tblType.SetValue(Grid.RowProperty, 2);
                grid.Children.Add(tblType);
                TextBox tbTypeId = new TextBox() { Text = askill.type.ToString() };
                tbTypeId.SetValue(Grid.ColumnProperty, 1);
                tbTypeId.SetValue(Grid.RowProperty, 2);
                grid.Children.Add(tbTypeId);
                TextBox tbType = new TextBox() { Text = Utility.ParseSkillType((ActiveSkillType)askill.type) };
                tbType.SetValue(Grid.ColumnProperty, 2);
                tbType.SetValue(Grid.RowProperty, 2);
                tbType.SetValue(Grid.ColumnSpanProperty, 2);
                grid.Children.Add(tbType);
                TextBlock tblAttr = new TextBlock() { Text = "attribute" };
                tblAttr.SetValue(Grid.ColumnProperty, 0);
                tblAttr.SetValue(Grid.RowProperty, 3);
                grid.Children.Add(tblAttr);
                TextBox tbAttr = new TextBox() { Text = Utility.ParseAttributeToString(askill.attribute) };
                tbAttr.SetValue(Grid.ColumnProperty, 1);
                tbAttr.SetValue(Grid.RowProperty, 3);
                grid.Children.Add(tbAttr);
                TextBox tbSubAttr = new TextBox() { Text = Utility.ParseAttributeToString(askill.sub_attr) };
                tbSubAttr.SetValue(Grid.ColumnProperty, 2);
                tbSubAttr.SetValue(Grid.RowProperty, 3);
                grid.Children.Add(tbSubAttr);
                //gridStyle
                Grid gridStyle = new Grid();
                gridStyle.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(50) });
                gridStyle.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(1, GridUnitType.Star) });
                TextBlock tblStyle = new TextBlock() { Text = "style" };
                tblStyle.SetValue(Grid.ColumnProperty, 0);
                gridStyle.Children.Add(tblStyle);
                TextBox tbStyle = new TextBox() { Text = Utility.ParseStyletype(askill.style) };
                tbStyle.SetValue(Grid.ColumnProperty, 1);
                gridStyle.Children.Add(tbStyle);
                gridStyle.SetValue(Grid.ColumnProperty, 3);
                gridStyle.SetValue(Grid.RowProperty, 3);
                grid.Children.Add(gridStyle);
                //gridInfo
                Grid gridInfo = new Grid();
                gridInfo.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(1, GridUnitType.Star) });
                gridInfo.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(1, GridUnitType.Star) });
                gridInfo.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(1, GridUnitType.Star) });
                gridInfo.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(1, GridUnitType.Star) });
                gridInfo.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(1, GridUnitType.Star) });
                gridInfo.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(1, GridUnitType.Star) });
                TextBlock tblPhase = new TextBlock() { Text = "phase" };
                tblPhase.SetValue(Grid.ColumnProperty, 0);
                gridInfo.Children.Add(tblPhase);
                TextBox tbPhase = new TextBox() { Text = ((SkillPhase)askill.phase).ToString() };
                tbPhase.SetValue(Grid.ColumnProperty, 1);
                gridInfo.Children.Add(tbPhase);
//.........這裏部分代碼省略.........
開發者ID:WindWT,項目名稱:RTDDE.Executer,代碼行數:101,代碼來源:Unit.xaml.cs


注:本文中的System.Windows.Controls.RichTextBox.SetValue方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。