2011-05-27 153 views
0

enter image description hereWPF:自定义控件

我的问题:
如何建立自定义布局像以上图片控件?

by Microsoft Expression Blend? 如何?

请直接我正确的文章或讨论你有什么

回答

3

的Expression Blend 4有一些内置的形状,可以帮助你在这里。基本上,您想要重新模板TextBox控件以包含语音气泡形状而不是标准Border

另外,你可以做到这一点,而无需重新模板化。事情是这样的:

<UserControl xmlns:ed="http://schemas.microsoft.com/expression/2010/drawing" Margin="100"> 
    <ed:Callout AnchorPoint="-0.13,0.29" CalloutStyle="RoundedRectangle" Fill="#FFF4F4F5" Stroke="Black"> 
     <ed:Callout.Content> 
      <TextBox BorderThickness="0" Background="Transparent">Hello</TextBox> 
     </ed:Callout.Content> 
    </ed:Callout> 
</UserControl> 

enter image description here

顺便说一句,你真的是TextBox,或者你实际上意味着TextBlock?如果后者,你所需要的只是:

<ed:Callout AnchorPoint="-0.13,0.29" CalloutStyle="RoundedRectangle" Fill="#FFF4F4F5" Stroke="Black" Content="Hello"/> 
+0

重新实施什么? ,它要实现的具体容器是什么? – 2011-05-27 19:13:17

+2

重新模板,不重新实现。 – 2011-05-27 19:15:08