Hi
How to create Rounded Text Box In WPF using Infrsgistics Tool?
Hello,
You can use one of our Editor controls. The closest to TextBox would be the xamMaskedInput. You would still need to template the control, just like you would do with TextBox in order to give it a rounded border look.
Here is an example of one way of doing it with ControlTemplate:
XAML Namespaces:
xmlns:igEditors="http://infragistics.com/Editors"
xmlns:igPrim="http://schemas.infragistics.com/xaml/primitives"
XAML Code:
<ControlTemplate x:Key="maskedEditor" TargetType="ig:XamMaskedInput"> <Border x:Name="MainBorder" CornerRadius="5" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}"> <Grid> <igPrim:MaskedInputTextBox x:Name="PART_InputTextBox" Foreground="{TemplateBinding Foreground}" TextAlignment="Center"/> </Grid> </Border> </ControlTemplate>
. . .
<ig:XamMaskedInput Text="xamMaskedEditor" Height="30" Width="200" Margin="5" PromptChar="" Template="{StaticResource maskedEditor}" > </ig:XamMaskedInput>
Hopefully this works for you. Let me know if you have any questions.
Sam
Thank u Sam and one more help i want know about In Wpf application how can we create rounded corner combo box using Infragistics XamMultiColumnComboEditor?
For modifying the border appearance of xamMultiColumnCombo I recommend copying the default style (generic.xaml) into your project, and change it locally and then reference it in your App.xaml.
Here is what you can do.
1. Copy the generic.xaml file that is added to the following location by the product installer:C:\Program Files (x86)\Infragistics\NetAdvantage 2012.1\WPF\DefaultStyles\XamComboEditor
2. After copying it into your project reference it in your project's App.xaml as follows:
<Application.Resources> <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="/generic.xaml" /> </ResourceDictionary.MergedDictionaries> </ResourceDictionary></Application.Resources>
3. Inside the generic.xaml find the style with TargetType="ig:XamMultiColumnComboEditor", which contains a control template for XamMultiColumnComboEditor. The control template contains multiple borders. Find the border with x:Name="ContentPresenterBorder". This one is the red border on the screenshot. The other border (blue in the screenshot) is defined with x:Name="borderEditMode" inside the same control template. The CornerRadius property of the Border is what gives rounded corner appearance.
Let me know if you have any questions.