wpf-controls

Visual Studio On/Off Control in Windows Forms

How can I add the the sleek On/Off control to a Windows Forms application? Or do I need to use WPF? Example Ignore the red highlighted area, look at the on/off controls (screenshot lifted from Visual Studio Power Productivity Tools). ...

WPF Binding individual text boxes to an array....

If my programmer creates a .dll that I can reference in my WPF project, and his .dll contains an array or collection of continuously changing data, what is the best way for me to update many individual controls on my WPF form? The controls will be objects like textBlocks... The .dll can contain any type of data object for my program to...

How to automatically size TabControl in a DockPanel - WPF

I have a simple WPF Forms app. I have a DockPanel as my root panel. The first child is a StackPanel that has some controls in it, then the second control is a TabControl. What I want, and the panel types can change all they want is for the TabControl to maintain the fill size of the window except for what the first StackPanel consumes...

Windows Phone 7 - Deselecting ListBoxItem in nested ListBoxes

I have a ListBox with dates. Each ListBoxItem (date) have another ListBox with that date's events. When I select an event it gets highlighted (SelectedIndex/SelectedItem) and I navigate to another Pivot. This works fine. My problem is that every ListBox has it's own SelectedItem. I want to clear the SelectedItem from each ListBox, but ...

Working with WPF(C#) calendar control, hebrew and georgian dates conversion

I need to build a simple app, A calendar with notes, working with a simple db and standard calendar is easy. the problem is with a feature that i must add: I need that every note will have a Hebrew date and Georgian date; It should work "on the fly", meaning: a user will have the ability to add a note based on a date type of his choice,...

How do I make WPF TextBox acted as a compact form?

How do I make WPF TextBox acted as a compact form? This means that "label text" inside TextBox is hiding on the click or when there is "real text". See working prototype ...

how to set the usercontrol for ribbon window wpf

First I've create a wpf application, then i add new RibbonWindows to application, say it RibbonWindow1, now i want to set the content of the ribbon control via bellow code and show the ribbon: RibbonWindow1 ribWindow = new RibbonWindow1 { Title = "This is a ribbon window", Content = new UserC...

How do I change the background of my button on mouseover?

I have a WPF application written in C#. I have made a button. I changed the background color. How can I change the bluish color when mouse is over my button? And how to control animation/change time? ...

Problem sending UIElements via DependencyProperty in wpf

I have a usercontrol with a dependencyproperty that takes oen UIElement. So fare so good, the problem is I can not find the element's children. I think the problem is my lack of knowledge, could anyone tell me what the problem is and a possible solution? I have made a small test-program like this Usercontrol codebehinde: public UIEle...

Question about Horizontal alignment for WPF Image control

For the WPF Image control, Horizontal alignment doesn't work.. Any ideas? I've pasted the exact code below.. the image appears in the middle.. <Canvas Canvas.Top="550" Canvas.Left="225" Width="500" Height="100"> <Border BorderBrush="#323232" BorderThickness="75" Width="500" Height="100"></Border> <Image Canvas.Left="0" DataContext=...

WPF Tabindexes not behaving as expected - The force is weak....

Hi All, I have a WPF window / form with various controls. I have set the tabindexes in the desired ordered but am getting strange behavior. When tabbing through the window, the order should be as follows: first text boxes on the left, then the date controls on the right, then my tab control and tab pages and then only the buttons. Bu...

WPF Custom Control Containing Custom Child Controls

how do you render child controls contained withing a WPF custom control? <MyControl> <Mycontrol.Children> <MyChildControl /> <MyChildControl /> </MyConrtol.Children> </MyControl> I've created a parent control with basic properties, which renders correctly. I've also created child controls, which also render correctly whe...

Display ListBox by 2 branches in WPF

I have a listbox to display a datasource. The datasource has only one field ("ClassName"). I want the listbox is displayed by 2 branches. Example: ClassName: ClassName1 ClassName2 ClassName3 ClassName4 Display: => ClassName1 ClassName2 ClassName3 ClassName4 Just tell me how to do that please! thanks! ...

How to load a grid from XAML codes and add it to a stackpanel dynamically/at runtime?

I generate the XAML codes which actually describe a valid grid control - called the GridXAML. I want to create a grid object and add it to a stackpanel on my form. How can I 1) create an object from its XAML string value, and 2) add it dynamically to a panel? Please help! Giving a specific sample context as below. The generated grid's...

How can I change the color of each character in a textblock

I am writing a little diff tool and need to be able to change the color of a character depending on if its the same, added, removed. What would be the best way to handle this? Is a textblock a good control to start with? ...

WPF Ribbon's application menu alignment: bug or programmer error?

I'm using WPF 4's (in .NET 4) ribbon control, version 3.5.40729.1, in my application. (Edit: I also tested the newly released version 4.0.0.11019 to no avail.) The application menu and all sub-menu popups align as far left as possible, usually far outside the ribbon window. The expected location is that the application menu's left edge a...

How to add a WPF grid control from its XAML string at runtime?

Let's say we have a grid XAML like below - eg. a generated string returned from a method. <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width='*' /> <ColumnDefinition Width='*' /> </Grid.ColumnDefinitions> <TextBlock Text='id' Grid.Column='0'/> <Rectangle Fill='Black' Grid.Column='1' /> </Grid> What...

Bind WPF menu control to xml.

Hi, I have a WPF menu control. I am using MVVM model. I have an XMLDataProvider in resource file. Can I bind it to an XML file (similar to asp.net 2.0) ? Thanks in advance !!! ...

WPF Hierarchial Treeview Multbinding Mixed List Problem

I'm having a tough time solving this simple issue : I am using a treeview with HierarichalDataTemplate to show an hierarchy of two entities : Organization and Unit. The Organization has a many to many relation with itself as it could have sub organizations. And each Organization has one to many relation with Unit, as an organization co...

Newb: WPF custom graphic control - where to start

Hi All, Apologies if there is a thread for this already, I couldn't find one that I could get my teeth into. Anyway, I'm new to WPF and want to create a custom control that will be a sort of graphic control. The graphic will always consist of a circle, containing a matrix of several squares (from several hundred to several thousand act...