English 中文(简体)
2. 银根案文 tri和包装问题
原标题:Silverlight text trimming and wrapping issue

我在XAML中有以下规定:

    <StackPanel Height="40">
        <TextBlock TextWrapping="Wrap" TextTrimming="WordEllipsis"  Margin="0,10,0,10"
                               LineHeight="18" FontSize="12">
                        Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce dapibus commodo dui vulputate laoreet. Donec metus purus, consectetur ut sagittis ut, vestibulum id diam. Suspendisse in urna sem. Ut purus arcu, placerat quis tempus cursus, elementum sed sem. Duis condimentum semper tortor, a pulvinar dolor semper sit amet.
        </TextBlock>
    </StackPanel>

因此,在我方言中,有一个文本箱。 在这种例子中,我确定了母子的顶峰,但在我的实际应用中,这个高点被定得更高一些。

我必须在多线上展示这一案文,并用斜线作为三角行为。 问题是,如果我使用上文提到的XAML代码,案文的最后一行就会被切断。 我附上一张屏幕,以说明行为:

“texttakesdown”/

是否有办法解决这一问题? 预期的行为只能显示第一行和最后的斜线。

最佳回答

而且,由于我使用StackPanels而引发的问题。 在StackPanel内部,内容高度与显示所有内容一样大。 然而,母子宫的高度限制,内含的 content缩。

我把我的SackPanel更换到一个Grid和三明灯和安厅;包装工作现在像一个药店一样。

问题回答

http://msdn.microsoft.com/en-us/library/system.windows. Controls.textblock.texttriming%28v=vs.95%29.aspx”rel=“nofollow” http://msdn.microsoft.com/en-us/library/system.windows. Controls.textblock.texttriming%28v=vs.9529.aspx

The TextTrimming property has no effect unless the TextWrapping property is set to NoWrap.





相关问题
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. ...

热门标签