wpf

Any reason why PresentationTraceSources.TraceLevel=High would not print any info to the output window?

I've been trying to get to the bottom of an issue with binding the SelectedItem of my ComboBox and since I've had not success thusfar I started looking at ways to get more detailed debugging information by setting PresentationTraceSources.TraceLevel=High for specific bindings. Unfortunately after doing so I don't see any related items in...

Problem with custom aero window

Hi all, i ran into a problem while developing my own custom WPF Aero Window. I created a custom WPF control derived from Window I created a Generic Template (for XP an Non-Aero-Clients) and i set the WindowStyle to None and the ResizeMode to CanResize. I designed my own title bar. Everything fine. At the moment i'm doing the same ...

How to program "Selection Changing" event in ListBox in WPF?

I have a listbox and I want to prevent changing of ListBox's selection if user has not finished certain tasks, this is the best explanation i can provide at this time, in WinForms there used to be selection changing and it has cancellable event arguement, where in we could trap and cancel even of changing the selection. I thought I will...

How to handle Win+Shift+LEft/Right on Win7 with custom WM_GETMINMAXINFO logic?

I have a custom windows implementation in a WPF app that hooks WM_GETMINMAXINFO as follows: private void MaximiseWithTaskbar(System.IntPtr hwnd, System.IntPtr lParam) { MINMAXINFO mmi = (MINMAXINFO)Marshal.PtrToStructure(lParam, typeof(MINMAXINFO)); System.IntPtr monitor = MonitorFromWindow(hwnd, MONITOR_DEFAULT...

How do I use a DataGrid to display the contents of a MDB

I'm relatively new to .Net 4 and I am creating my FIRST WPF application using a MDB as a backend datasource. I designed my UI. I have a TextField (called Name), a Combobox (called Division) and a DataGrid (called dataGrid1). The only problem I'm having is figuring out how to link my DataGrid to display data from the DataSource. and loa...

wpf chart show horizontal scroll bar/viewer

Hello, I have a wpf column series chart and I have more than 15 columns. I want the horizontal scroll to show up. And i am not able to. Any help. ...

Is there some kind of a common WPF stylesheet?

I have a simple window. <Window x:Class="WPFTest.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" SnapsToDevicePixels="True"> <Grid> <Grid.RowDefinitions> <RowDefinition Height="*" /> <RowDefinition Height="Au...

Remove SelectedItems from a ListBox via MVVM RelayCommand

I have a list of items in a WPF ListBox. I want to allow the user to select several of these items and click a Remove button to eliminate these items from the list. Using the MVVM RelayCommand pattern, I've created a command with the following signature: public RelayCommand<IList> RemoveTagsCommand { get; private set; } In my View, I...

WPF Popup - when to disable, how to keep in relative position to origin control? ;)

2 simpl questions. Given a WPF popup... What is a good way to hide it again when it is used like a submenu? WHich event is proper? WHat is the way to keep it's position stable relative to the origin control? THanks in advance ;) ...

WPF WebBrowser NavigateToString vs NavigateToStream (hebrew/non-utf8 encodings)

When I use WPF WebBrowser's NavigateToString method to display UTF8 html (with hebrew text in it) it's displayed perfectly. However, when I try to use the NavigateToString to display html with hebrew text in it in a non-utf8 encoding (CodePage 1255 to be exact) the hebrew is messed up. I checked the cp1255 string in Visual Studio's deb...

Custom Image Button and Radio/Toggle Button from Common Base Class

Hi All, I would like to create a set of custom controls that are basically image buttons (it's a little more complex than that, but that's the underlying effect I'm going for) that I've seen a few different examples for. However, I would like to further extend that to also allow radio/toggle buttons. What I'd like to do is have a comm...

Glowing Label Controls On A Glass Surface

Is there any way, and any tutorials, articles, samples around that allow each and every new Label Control created at runtime to have a Glow around it, just like on Vista/7? Thank you ...

Help with error: The file 'MainWindow.xaml' is not part of the project or its 'Build Action' property is not set to 'Resource'.

Oddly enough, googling this error doesn't produce any results. Is there any quick fix for this bug / known causes? The file's build action is Page like the rest of my xaml windows, and it is definitely part of the project. ...

Prevent a control in a grid to change its column width

Hello, I can't figure out how to manage properly the width of a grid column with a user control in one of its cell. I have this xaml for a window: <Grid> <Grid.RowDefinitions> <RowDefinition Height="auto" /> <RowDefinition Height="auto" /> <RowDefinition Height="*"/> </Grid.RowDefinitions> <Grid.Colu...

Change Key in WPF KeyDown

Legacy app conversion issue. VB6 TextBox_KeyDown() allows key to be changed (e.g. force keystroke to upper case but there are many other uses). How can this be done in WPF? The only way I can see is too handle all TextBox keystrokes. In effect, reimplement TextBox editing. I'd rather not go there. ...

WPF - Binding to a list within a Listview Item

So I am trying to bind to a list within a ListView item but I can't seem to get the binding correct. If some one could help me with the corrected binding that would be great! Here is the source you will probably need: //class that xaml is initially bound to public partial class UploadMngPanel : Grid { .... //initial list to bin...

WPF - Pausing the UI Thread?

I have a tab control with draggable tabs. When the mouse is released it removes the selected tab from the tabControl and adds it to its new location. My problem is that the TabControl draws itself after removing the tab, and then again when adding the tab so there is a very noticeable flicker that shows the tab behind the tab being moved...

Creating a WPF Textbox Control like Outlook email recipient textbox

Hi, I'm looking to create a WPF textbox control that acts similar to the email recipient textboxes in Outlook (the To, Cc and Bcc inputs). I don't necessarily care that much about auto-completion (i've found millions of examples for that), but what I'm really struggling with is how to have delimited text entries in the textbox behave as...

Use a user control as a dataTemplate within a WPF application

Hello, I am trying to create a user control within a WPF application that will serve as a data template for a listbox item. The user control a grid with 4 textblocks. This control also contains other shapes and images more for visual aid than anything so I am omitting them from the code in this question for clarity. When I drop the use...

Command Binding And The Backspace Key

I need to bind a command to the Backspace key. The command needs to be enabled when keyboard focus is in a textbox, which in turn is inside of the DataTemplate for an ItemsControl. The following code doesn't seem to acknowledge that the backspace key is being depressed, and the CanExecute handler for the CommandBinding isn't getting ca...