English 中文(简体)
在选定区域写入文字
原标题:Write text in the selected areas

我有这个WPF代码。

<TextBlock Name="TB" TextWrapping="Wrap" Text="das   asd     asdasd  asd asd as d as   2323213      123123" Style="{StaticResource PhoneTextTitle1Style}"/>

我需要写一个文字 在其中的红色区域之一。

""https://i.sstatic.net/1KDef.png" alt="此处输入图像描述"/"

同时,我需要具体说明案文的立场如下:

    TB.Inlines.Add(new Run() { Text="123", ContentX = 4, ContetLine= 1});
    TB.Inlines.Add(new Run() { Text="B", ContentX = 6, ContentLine= 2});
    TB.Inlines.Add(new Run() { Text="55555", ContentX = 7, ContentLine= 4});

文本可以通过使用带有自定义文本颜色和样式的 Inlines 添加 。

我不知道字体大小和文字被包裹的位置。

<% 1 :

案文可能不同。

字符可以样式化( 颜色、 字体大小、 文本样式 ) 。

我需要像全方位的字符和指针一样的东西

问题回答

Regular Expressions maybe? (using System.Text.RegularExpressions) To find the first space the code would be:

  [a-z]+

你只要数数找到的字符 然后剪断字符串就可以了





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签