Nitin Goel

Nitin Goel

  • NA
  • 19
  • 2.8k

Change Text Box Design

Jun 23 2014 5:34 AM
I want to show my text box as Process Box(Flow Chart Process Box).Following code change looks of text box but it will be not editable now.Please help.Thanks in advance.

<TextBox Text="It's a TextBox control">
               <TextBox.Style>
                   <Style TargetType="TextBox">
                       <Setter Property="Template">
                           <Setter.Value>
                               <ControlTemplate>
                                   <Path Style="{StaticResource Process}" ToolTip="Process">
                                       <s:DesignerItem.DragThumbTemplate>
                                           <ControlTemplate>
                                               <Path Style="{StaticResource Process_DragThumb}"/>
                                           </ControlTemplate>
                                       </s:DesignerItem.DragThumbTemplate>
                                   </Path>
                               </ControlTemplate>
                           </Setter.Value>
                       </Setter>
                   </Style>
               </TextBox.Style>
           </TextBox>


<Style x:Key="Process" TargetType="Path" BasedOn="{StaticResource FlowChartItemStyle}">
   <Setter Property="Data" Value="M 0,0 H 60 V40 H 0 Z"/>
 </Style>
 
 <Style x:Key="Process_DragThumb" TargetType="Path" BasedOn="{StaticResource Process}">
   <Setter Property="IsHitTestVisible" Value="true"/>
   <Setter Property="Fill" Value="Transparent"/>
   <Setter Property="Stroke" Value="Transparent"/>
 </Style>