Custom ComboBox
-
1.I have implemented the control template of combobox from examples of MSDN.But the problem is cursor from the editable textbox is moving out of the box . 2.I have implemented a borderless window with WindowStyle="None", but the problem is when maximized ,it is covering task bar also? Please help me to fix the above probs.. Thanks
-
1.I have implemented the control template of combobox from examples of MSDN.But the problem is cursor from the editable textbox is moving out of the box . 2.I have implemented a borderless window with WindowStyle="None", but the problem is when maximized ,it is covering task bar also? Please help me to fix the above probs.. Thanks
Hi, Without looking at the code it is a bit uneasy to comment anything regarding the probable cause of this issue. However, I would suggest you to take a look at the following articles which deals with Custom CombBox creation and see if this helps. http://www.codeproject.com/KB/miscctrl/Parasite_Pattern3.aspx[^] http://www.codeproject.com/KB/combobox/extending_combobox.aspx[^] Hope this helps :).
Regards, John Adams ComponentOne LLC
-
Hi, Without looking at the code it is a bit uneasy to comment anything regarding the probable cause of this issue. However, I would suggest you to take a look at the following articles which deals with Custom CombBox creation and see if this helps. http://www.codeproject.com/KB/miscctrl/Parasite_Pattern3.aspx[^] http://www.codeproject.com/KB/combobox/extending_combobox.aspx[^] Hope this helps :).
Regards, John Adams ComponentOne LLC
Hi Please have a look at the code.By implementing the below control teplate for a combobox.the cursor is coming out of combobox.Please aadvise. <ControlTemplate x:Key="ComboBoxToggleButton" TargetType="{x:Type ToggleButton}"> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition/> <ColumnDefinition Width="20"/> </Grid.ColumnDefinitions> <Rectangle Grid.ColumnSpan="2" HorizontalAlignment="Stretch" x:Name="Rectangle" VerticalAlignment="Stretch" Width="Auto" Height="Auto" RadiusX="5" RadiusY="5" Fill="{DynamicResource NormalBrush}" Stroke="{DynamicResource NormalBorderBrush}"/> <Rectangle Grid.Column="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="Auto" Height="Auto" RadiusX="5" RadiusY="5" Fill="{DynamicResource WindowBackgroundBrush}" Stroke="{DynamicResource NormalBorderBrush}"/> <Path Grid.Column="1" HorizontalAlignment="Center" x:Name="Arrow" VerticalAlignment="Center" Fill="{DynamicResource GlyphBrush}" Data="M 0 0 L 4 4 L 8 0 Z"/> </Grid> <ControlTemplate.Triggers> <Trigger Property="IsMouseOver" Value="true"> <Setter Property="Fill" Value="{DynamicResource MouseOverBrush}" TargetName="Rectangle"/> </Trigger> <Trigger Property="IsChecked" Value="true"> <Setter Property="Fill" Value="{DynamicResource PressedBrush}" TargetName="Rectangle"/> </Trigger> <Trigger Property="IsEnabled" Value="False"> <Setter Property="Fill" Value="{DynamicResource DisabledBackgroundBrush}" TargetName="Rectangle"/> <Setter Property="Stroke" Value="{DynamicResource DisabledBorderBrush}" TargetName="Rectangle"/> <Setter Property="Foreground" Value="{DynamicResource DisabledForegroundBrush}"/> <Setter Property="Fill" Value="{DynamicResource DisabledForegroundBrush}" TargetName="Arrow"/> </Trigger> </ControlTemplate.Triggers> </ControlTemplate> <!-- This is the area which contains the selected item in the ComboBox --> <ControlTemplate x:Key="ComboBoxTextBox" TargetType="{x:Type TextBox}"> <!-- This must be named as PART_ContentHost --> <Border x:Name="PART_ContentHost" Focusable="False" Background="{TemplateBinding Background}"/> </ControlTemplate> <!-- Simple ComboBox This uses the ComboBoxToggleButton to expand and collapse a Popup control SimpleScrollViewer to allow items to be scrolled and SimpleComboBoxItem to def