wpf-controls

keep focus in a WPF combo box in an addin

I have a combobox in a Word addin. The contents of the combobox are often long enough to drape over Word's Zoom slider-bar control. However, selecting an item directly over the zoom control (which is hidden from view) causes the zoom control to get focus, close the combobox, and change your zoom setting! The selection in the combobox is ...

Element host loading time issue with winforms

I have an element host with 3 WPF controls. I am placing the element host on a winform. When my application is coming up, the element host is taking few seconds and the winform is getting displayed as a blank screen. How to fix this? Any ideas are appreciated. Basically, I don't want to display the blank screen as it looks ugly when th...

WPF User Control

how to add image in radio button. Image can be change melodramatically. ...

How to add a focus to an editable ComboBox in WPF

I am using an editable ComboBox in wpf but when i try to set focus from C# code, it is only shows selection. but i want to go for edit option (cursor should display for user input). ...

WPF TextBlock text changed notify

Hey guys, I have a screen contain about 15-20 TextBlocks each one bind to a different property, at first all the TextBlocks are empty the text update come from other client . the thing I want to do is to animate flashing text for 3 seconds when ever text change. i used the below storyboard to make that happen: <Setter Property...

WPF Checkbox won't display a UIElement as its content.

I'm working with a custom checkbox, and I'm trying to set the content to a WPF Viewbox. The problem is, simply, nothing is displayed. The checkbox appears and works, but it has no content. This is sample code (not the actual code) of what I'm trying to do. MyCheckbox myCheckbox = new MyCheckbox(); Viewbox viewbox = new Viewbox(); viewb...

How to setup bindings to user controls in separate directories

to date I have created and setup bindings and dependencies between controls and other objects when they are located within the same directory or within the same xaml document. Now I have created a usercontrol which is located in a directory of my project called "Controls" this control is then loaded within the main xaml document using ...

WPF Screenshot JPG from UIElement with C#

Hi all. I'm trying to create a JPG from part of my WPF Applications. Like a screenshot, only of individual UI Elements. I started here: http://www.grumpydev.com/2009/01/03/taking-wpf-screenshots/ I am using his extension method, which essential allows you to get a byte[] with UIElement.GetJpgImage(). This can then be written using a...

WPF - How to style the menu control to remove the left margin?

I have added a default menu control to my user control. I need to style the menu to remove the left margin containing the space for the icon or checkbox. How can I do this? XAML: <Menu> <MenuItem Header="MyMenu" FontSize="10"> <MenuItem Header="Options..." /> <MenuItem Header="About" /> </MenuItem> </Menu> ...

How to automatically scroll ScrollViewer - only if the user did not change scroll position

I would like to create the following behaviour in a ScrollViewer that wraps ContentControl: When the ContentControl height grows , the ScrollViewer should automatically scroll to the end. This is easy to achive by using ScrollViewer.ScrollToEnd(). However, if the user uses the scroll bar, the automatic scrolling shouldn't happen anymore....

WPF creating custom control - creating control like SpinBox extending TextBox

Hi, What is the best way to extend a control? Lets choose for example SpinBox - we want to extend TextBox to SpinBox - just to add two buttons on the right side, which each one on click checks if Text property is a valid number and if it is increases or decreases the value by 1. Suposse that we have a lot of code using TextBox (Text, IsR...

Which WPF Control Suite?

If you were to buy one control suite for WPF, which would it be? EDIT - I know that this is vague and understand that the answer might be different depending on the exact requirements. I guess what I'm getting at is that there are numerous WPF control libraries out there (e.g. Infragistics, Telerik, Syncfusion to name but a few) and ins...

data validation on wpf passwordbox:type password, re-type password

Hello Experts !! I've built a wpf windows application in with there is a registration form. Using IDataErrorInfo i could successfully bind the field to a class property and with the help of styles display meaningful information about the error to users.About the submit button i use the MultiDataTrigger with conditions (Based on a p...

How to get the text in list box to be right aligned?

My ListBox is databound to 2 fields. The first is left aligned which is fine, the problem is with the second one which has to be right aligned. I tried using TextAlignment ="Right" and also HorizontalAlignment="Right", none of them worked. Here is a sample code: <ListBox x:Name="_listBox"> <ListBox.DataTemplate> <DataTemplate...

How to correctly bind an object to a WPF DataGrid?

I'm trying to get a WPF DataGrid to work from a user control I'm building. Things seems to work fine. But I noticed this message in the Output window in the IDE: System.Windows.Data Error: 39 : BindingExpression path error: 'Name' property not found on 'object' ''Object' (HashCode=18165668)'. BindingExpression:Path=Name; DataItem='Obje...

WPF Unleashed error?

The book says The WPF Button class only adds two simple concepts on top of what ButtonBase already provides: being a cancel button or a default button. These two mechanisms are handy short- cuts for dialogs. If Button.IsCancel is setto true on a Button inside a dialog (that is, a Window shown via its ShowDialog meth...

Possible to Freeze Columns in a WPF ListView/GridView?

I currently have a GridView inside a ListView.View. The GridView columns will far exceed the width of the screen, so there will always be horizontal scrolling. What I would like to do is to have certain columns always remain on the screen regardless of scrolling. So the first x columns from the left are frozen (ala Excel), and the res...

Input string was not in correct format.

Hi Experts, I had a Ribbon like custom control. I created an application using this control. These applications work fine until I change the system number format. They crashes if I change the system number format like below: Current Format = English (United State) Decimal symbol = ',' Digit group symbol = '.' When I run application...

How to edit Parent ListboxItem from seperate Listboxes that are hierachically linked.

I have a rather complicated Binding situation. I have a solution that I created in windows forms for this back in VS2005, but now I am recreating the control using wpf, but I am not doing it in exactly the same way I had done it before. I have a listbox control that has the following DataTemplate: <DataTemplate> <Border CornerRadius=...

Synchronize Bindings of multiple Properties in a UserControl

I have an ugly race condition with a WPF usercontrol, which is some kind of extended ComboBox: The UserControl mainly defines two bindable DependencyProperties, one is the selected item, another one is a list, from which the selected item can be chosen. Both are bindable, so the control may be initialized with or without a selected item ...