wpf

Good NumericUpDown equivalent in WPF?

I'm looking for a simple NumericUpDown (a.k.a. number spinner) control in WPF. This seems to be another lacking control in WPF. There must be some existing ones out there and I don't like to re-invent the wheel. ...

How to add nodes to a WPF treelist using VB.net (2008)

I need to create a wpf treeviewlist to look something like this: AAAA BBBB ....CCCC ....DDDD .......EEEE FFFFF (where the dots above are indents) I need to do this from vb.net (2008) code. I've spent an embarrassingly long amount of time trying to figure this out, and so far all I’ve got is: vb.net: Dim tvi1, tvi2 As TreeView...

How to style the slider control in WPF?

I want to style the slider control so that the height of the draggable thumb is set to 8 pixels. What is the simplest way to do this in WPF? <Slider> <Slider.Style> <!-- which xaml here? --> </Slider.style> </Slider> ...

WPF - How to display loading message for web browser control

Hi, I have a window with 2 column grid. Left column contains a browser control I woould like to display a little window or something to show a that the webpage is still loading. How could I do this?? Could I have a floating window in the 2nd column that shows in front of the browser??? please explain how? Malcolm Thanks bendwey wor...

Silverlight button style how to prevent the focused state when the button is pressed?

In my custom button I need to show that it had focus(provides some tactile feel to tabbing to the button) and show that its pressed but what I have found is my focused state is displaying rather then my pressed state. How can I correct this. I would like to have mouse over to pressed not mouse over then focused(when the button is cli...

How to allow plugins to have custom properties?

Hi I have wpf app and I am allowing usercontrol plugins that implement an interface. i want to allow the plugins to have their own properties but I want to have these properties access from menu in the host. How would this be architected best? The properties could be string, double etc. Malcolm ...

View lost when refreshing ObjectDataProvider

I'm implementing a textbox filter on a list based on Josh Smith's example at http://joshsmithonwpf.wordpress.com/2007/06/12/searching-for-items-in-a-listbox. Basically, it sets the Filter on the view to a delegate that checks against the text in the search box. I hook up the filter like so: var pickerView = FindResource("sortedRulesView...

How do you implement default text for a search box in WPF?

I want to implement something exactly like "Changing the Default Text in the Search Box" from http://msdn.microsoft.com/en-us/library/aa905322.aspx for a WPF search TextBox. The box should show some greyed out "Search.." text when it's empty, and then function normally when typed in. The linked article shows how to do this in javascript....

How do I get an Icon from a png image?

I'm creating an WPF app, so I'm mostly working with the ImageSource class for icons. However, the system tray icon has to be of type System.Drawing.Icon. Is it possible to create such an object from a png image? I have tried the following: private static System.Drawing.Icon _pngIcon; public static System.Drawing.Icon PngIcon { get ...

Applying a single style to multiple controls (and tweaking each style)

Hi all, I have a WPF application that is using a custom style. In it I have a set of buttons that each have a custom background image. For each button, I'm supplying a normal and a mouse down image. Is there a simple way to do this with a single style (and customize each button on a case by case basis)? Currently I'm creating a ne...

WPF TextBox and Scroll behavior

I have a problem. I need to host grid with controls in ScrollViewer to prevent textbox from being either truncated or collapsed to zero-with at the UI. Also I want the with of textbox to be expanded when user change windows width. I'm setting Window's content to following code <DockPanel> <TreeView DockPanel.Dock="Left" Width="150"/...

How Can I Only Allow Uniform Resizing in a WPF Window?

I don't want my window to be resized either "only horizontally" or "only vertically." Is there a property I can set on my window that can enforce this, or is there a nifty code-behind trick I can use? ...

Are routed events weak in WPF

Does routed events in WPF store strong reference to the handler that is attached to them? ...

Get Absolute Position of element within the window in wpf

I would like to get the absolute position of an element in relation to the window/root element when it is double clicked. The element's relative position within it's parent is all I can seem to get to, and what I'm trying to get to is the point relative to the window. I've seen solutions of how to get a the point of an element on the sc...

Hide Tab headers in WPF TabControl

What is the best way to hide Tab headers when there is only a single visible Tab? I want to hide TabControl chrome completely, while leaving the content of the Tab visible. ...

WPF : How can I get the height of a listview row

I need to know how high (in pixels) a row in a listview control will be, and can't find any way of getting it. Any ideas? The row just contains text, nothing fancy ...

WPF ListBox DataTemplate and Image Question

I have a ListBox with a StackPanel that contains an image and label. <ListBox.ItemsPanel> <ItemsPanelTemplate> <VirtualizingStackPanel Orientation="Horizontal" IsItemsHost="True" /> </ItemsPanelTemplate> </ListBox.ItemsPanel> <ListBox.ItemTemplate> <DataTemplate> <StackPanel Orientation="Vertical"> ...

WPF ListBox Image Selected the saga continues

Ok in my ListBox scrolling images w/ text, etc. the saga continues. When I click one of the items, to select it, that runs a process to open a web browser and go to a specific URL. The problem I'm having now is that when the WPF app loses focus, and the web browser opens, the item clicked inside the listbox turns white. Here's the whole ...

When is Winforms the correct choice vs. WPF?

Disclaimer: I'm not generally a Windows Client developer. I presume that WPF is intended to eventually replace WinForms altogether, but for now, they both are shipping. My question is, when is one more appropriate than another? Should we be leaving Winforms to legacy and creating new Windows Clients in WPF only? ...

How to reduce the memory usage of a WPF app.

I am working on a little bookmark managing app written in C#, using WPF. It just sits in the system tray and is idle 99% of the time. Recently I looked in the task manager and discovered that it uses around 25 megs of memory (and around 12 megs before it is activated for the first time) which I thought was a bit much for an app that does...