wpf

Can I navigate into and out of a wpf combo box using arrow keys instead of tab?

I have wpf UserControl containing a combobox and a textbox in a row. Currently the only way to move between the components is to tab between them, but I would like to also be able to switch from the combobox to the textbox using the left and right arrow keys. It is not as easy as just slapping an eventhandler on the keyup event. void C...

Change default highlight colour of TabItem in TabControl WPF

Hi, Im trying to change the default highlight colour of a tab item in a tab control in WPF. In the image the highlight colour is orange, I just want to know if there is away to change it to another solid colour? Here is my XAML which declares the TabControl and 2 TabItems <TabControl> <TabControl.Background> ...

how to disable "PRINT SCREEN" button while running my Application in WPF?

How will i disable Print Screen whil my WPF application is running...? ...

XPS document to PDF,DOC

Which one is the best third party libary to convert XPS to PDF and XPS to DOC. ...

Datagrid + Mouse right click event

I have a datagrid and it contains the list of files from the folder. I want to display the default window files right click options in right click on the filename. That is when ever i right click the filename in the datagrid, a default windows right click pop up should appear. Can anyone help me to sort this out. The project is in C#. ...

How set color for cell (DataGrid WPFtoolKIt)?

i need this set RED color. how to do it? DataTable dtSet = new DataTable(); string sql = @"requevst"; using (MySqlConnection connection = ConnectToDataBase.GetConnection()) { ... int count = adapter.Fill(dtSet); } double totalPrice = 0; foreach (DataRow row in dtSet.Rows) { to...

WPF Can a button carry data to it's event handler.

Ok this might be simple or just not possible. Probably it's something that is frowned upon. Let's say I have a combobox and a button beside it. I choose a item from the combobox and press the button. In my button handler I guess I'm supposed to fetch combobox.selectedValue to get the item ( is there a better way). Let's say I don't ha...

Can the F2 key be disabled in the WPF Datagrid?

In a WPF DataGrid the F2 key is used to edit current cell. The requirements in my software project says that F2 should do something else. I have added a keybinding, but it only works when keyboardfocus is not in the DataGrid. Can I disable or remove the DataGrid's keybinding to the F2 key? ...

How do I get a WPF element to respond to changes in a VB Module?

Hi, Objects whose Properties are observed for changes must implement the System.ComponentModel.INotifyPropertyChanged event to alert their WPF-element observers that a change has occurred. If I have a Visual Basic Module whose Properties I wish to have observed by a WPF element, how should I go about routing the Properties of that Modu...

WPF: Custom TextBox control not using ErrorTemplate

Hey everyone! For the life of me I can not get my Validation.ErrorTemplate showing for my custom Textbox control. I tried adding an AdornerDecorator out of desperation because I read that helps sometimes. If anyone can help point me in the right direction, that would be amazing. I uploaded a sample project if someone would rather see...

WPF and VB.net: Data Binding to Separate Class created outside of Expression Blend...

I have a WPF application with form that has a textbox named "txtStatusWindow". I also have a vb.net class handed to me by a co-worker that needs to be called and executed by the code in my application code-behind. My co-worker insists that I will need to use common .net events to update the textbox on my form. The separate vb.net class:...

BackgroundWorker: Enabling/Disabling Buttons in Completed Event not working after switching between UserControls

Hi there I have a problem with my BackgroundWorker placed in a UserControl. My WPF application has a navigation on the left and each entry loads its own UserControl where the user can generate a PDF file. Because the creation of the PDF takes some time I've implemented a BackgroundWorker which does the job and additionally I disable s...

DataGrid.ItemsSource.Refresh() not working

Hi I have a wpf form which contains a datagrid. I did put a button on my form to "Refresh" the datagrid. Steps I'm trying to get it to refresh: I update the viewsource from my db: SupportCaseViewSource.Source = SupportCaseManager.GetAllSupportCases(); I refresh the datagrid items: SupportCaseDataGrid.Items.Refresh(); But nothing ha...

Measure/Arrange Of Grids with SharedSizeGroup

There seems to be a bit of an issue with two grids containing elements specified in a certain way, and the SharedSizeGroup. This question is in response to an earlier question from user D.H. I attempted to answer. Forgive the length, but it helps to demonstrate the problem visually. His original question asked why two grids with a Sh...

A WPF RichTextBox + Button in a StackPanel => what a mess ?

This code: <StackPanel Orientation="Horizontal"> <RichTextBox /> <Button Content="Dialog" /> </StackPanel> shows the button somewhere on the left side of the StackPanel ONTO the RichTextBox, WHY? edit: Oh I just saw its a width problem. The RTB has nearly no width and the button is righth...

Route KeyUpEvent from UIElement to a TextBox

How do I route the KeyUpEvent event for a UIElement to a TextBox in WPF? For example with the following objects: <Rectangle x:Name="rectangleWPF"></Rectangle> <TextBox x:Name="textBoxWPF"></TextBox> If an 'A' is pressed on rectangleWPF then an 'A' must be inserted into textBoxWPF. Then if a backspace is pressed on rectangleWPF, text...

MessageBox with exception details immediately disappears if use splash screen in WPF 4.0

My desktop-based WPF-application (4.0) works with DB and in order to this it should establish a connection with SQL Server on application's startup. Of course, this operation takes some time and user have to wait some seconds (3-5) while .Net Framework start and connect to SQL Server. As appropriate in such kind of cases I decided to us...

BackgroundWorker vs NotifyPropertyChanged issue

Hi all! I have WPF application that performs some calculations in BackgroundWorker. The problem is that when I try to update property (which calls NotifyPropertyChanged in setter) in RunWorkerCompleted event handler I get InvalidOperationException - The calling thread cannot access this object because a different thread owns it. This M...

DocumentPaginator that works with any Visual?

Printing any visual is easy. Printing one that is larger than a single page is hard. I'm stuck. The docs are scarce and I've gotten as far as I can. I'm wondering if anybody has a class which extends DocumentPaginator that can take any visual (or even a UIElement) and split it across multiple pages. I attempted to create one, but I ...

Interchangeability / re-usability of WPF, Silverlight and Silverlight OOB applications?

For the experienced WPFers out there, how re-usable are WPF, Silverlight and Silverlight OOB applications and components? How much overlap is there? For example, could I write one application and easily deploy it in the three aforementioned ways? Ideally, I want to write as little code as possible and have the flexibility of deployin...