2011-05-27 152 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