Click here to Skip to main content
15,881,812 members
Everything / Desktop Programming / WPF

WPF

WPF

Great Reads

by Dr. WPF
.NET 3.5 SP1 is here! It's time to break out your DirectX skills. This article provides the information necessary to get started using a new DirectX interop feature in WPF called D3DImage.
by Daniel Vaughan
Calcium provides much of what one needs to rapidly build a multifaceted and sophisticated modular application. Includes a host of modules and services, and an infrastructure that is ready to use in your next application.
by Fredrik Bornander
WPF Implementation of the spinning panel frequently used on the iPhone
by Sacha Barber
It would probably be like Cinch, an MVVM framework for WPF.

Latest Articles

by Macabies Gilles
An easy-to-use filterable, multilingual custom DataGrid control for managing and filtering data for your WPF applications
by gabriel4sonic
Shows how to use OpenGL in a .NET WPF application by directly incorporating an OpenGL window as a child of the main WPF window, making it behave more like a control
by Jo_vb.net
Part 2 of my article about 'Schafkopf' introduces Automated Bidding
by Peter Sun (247)
Implement ChatGPT API in C# WPF with GPT3.5-turbo

All Articles

Sort by Title

WPF 

7 Sep 2014 by Jawad Shairf
you can simply override the default border brush to your own border brush
7 Sep 2014 by Member 10973822
Hello everyone, can someone help me with wpf buttonI want to remove the border and button glow effect.my button has an image background, it changes when the mouse hover but the button glows.here is the button code, I'm using visual studio 2010
10 Dec 2013 by Member 8920414
Here is the link to this articles WPF DataGrid Practical Examples Ran the code with Visual Studio 2012 after installing the WPF Toolkit from add refrences. It compiles, and appears to run, but the buttons do not all work correctly. That buttons that crashes the program are listed...
23 Aug 2005 by Its Piyush Gupta
In the Vista world, application type selection is based on security requirement and deployment method but not on user interface requirements. This article describes various application types supported by Avalon sub-system of the Vista operating system.
1 Feb 2015 by sumitk.cadc
Hi,I am using crystal report in my wpf app for showing reports.its all working fine.but after creating exe when i am going to show reports using APP shortcut(which is created when i install exe) its giving me error like below{"Load report failed."}Inner exception is{"Unsupported...
2 Feb 2015 by /\jmot
You will need to modify two properties in the .rpt files:Build Action is set to "Embedded Resource" by default. Change it to "Content".Copy to Output is set to "Do not copy" by default. Change it to "Copy always".Rebuild, Build deployment package and Publish....
2 Feb 2015 by Sanman Marathe
i faced similar kind of situation while working and even after doing the changes from solution1 above , i realized a stupid mistake a very annoying one though.check the path you're calling the crystal report from, and use the "\" till the end of the path if its being passed dynamically.
16 Jan 2011 by Yao.guo
What's the meaning of "path property must set before calling the send method"?The error is too hard. I can't Find the way.Is the error about WebServer? Please Help me
16 Jan 2011 by #realJSOP
If this is in connection with a web service, that error means that the WSDL doesn't have a Service section defined to specify where the web service is located.If you google the error, you'll probably be able to find an more precise description of your problem.
16 Jan 2011 by Espen Harlinn
This would be a great place to start learning about WCF:Windows Communication Foundation - Getting Started Tutorial[^]I can only guess that you are new to WPF and WCF - going through the tutorials will probably enable you to find the solution yourself. Knowing the bits and pieces the...
16 May 2010 by Helloworld922
I'm trying to add some custom content parsing in a TextBox using the PreviewKeyDown method (i'm just adding some text to the beginning of multiple lines and updating the selection position/length). However, whenever I make a change to the TextBox object, that event is being marked as...
24 Jan 2016 by Daniel Brousser
Custom TextBox control for UI input validation
22 Nov 2023 by Evilfish2000
I'm not sure why I get this error and I have been trying a bunch of stuff. I have this WPF UserControl that I am building:
25 May 2015 by Member 10627743
I am developing an app in WPF that is going to make use of entity framework CRUD operations, but am stuck at a line of code and could not proceed. in one of the classes there is a red underline on "[Foreignkey("DepId")]" with an error message "'entityframework.models.foreignkeyAttribute' does...
25 May 2015 by Duncan Edwards Jones
You should add the System.ComponentModel.DataAnnotations namespace.See this tip...[^]
19 Jun 2019 by Member 10738387
i'm New to WPF, started creating a WPF application with ExtendedDataGrid/wpfextended, when i try to implement ExtendedDataGrid in the TabControl like below,
28 May 2019 by Gerry Schmitz
Considering you are "new" to WPF, why are you bothering with "ExtendedGridControl" when WPF has a "native" datagrid control? For all intents the "extended grid" is a "3rd party" grid that stood in until WPF got a "native" grid (a few years ago). Use the native WPF data grid control. The...
19 Jun 2019 by PureNsanity
That problem means something has already registered that DependencyProperty name on that class. Normally this happens for one of two reasons: 1. The DependencyProperty field was not declared as static. 2. There was a cut and paste error re-registering the same name for a different...
27 Aug 2022 by prashanth manoj
private void btnSave_Click(object sender, RoutedEventArgs e) { if (txtCompanyId.Text == "") { MessageBox.Show("Please Enter CompanyId", "Fill Field", MessageBoxButton.OK,...
27 Aug 2022 by Graeme_Grant
Yep, you are trying to pass a control object to a string field. That is what the error message is saying. You need to use the Text property from the control is get the value. Here is one example: Change: ...
27 Aug 2022 by Tony Hill
You are setting all the database fields to contain the windows control id and not the text content of the controls. cmd.Parameters.AddWithValue("@company_id", SqlDbType.VarChar).Value = txtCompanyId; and ...
28 Aug 2022 by prashanth manoj
public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); WindowState = WindowState.Maximized; WindowStyle = WindowStyle.None; } ...
28 Aug 2022 by OriginalGriff
Somewhere in this code: cmd.Parameters.AddWithValue("user_id", SqlDbType.NVarChar).Value = string.IsNullOrWhiteSpace(txtUserId.Text) ? DBNull.Value : (object)txtUserId.Text; cmd.Parameters.AddWithValue("emp_id",...
17 Sep 2014 by sureshsankar
how to display " No Record Found" Message in RowDetailsTemplate of WPF datagrid, if there is no record in itemSource? I am using following code in MVVM structure
15 Jul 2015 by Mohammed Shamsheer
Application x:Class="FortySixApplesResourceDictionaryDemo.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" StartupUri="MainWindow.xaml"> ...
9 Mar 2009 by Paul_Wade
A WPF application for viewing RSS video feeds. Built using the MVVM pattern.
27 Mar 2012 by SvenMe
Good morning everyone,I recently started playing around with Metro Apps. I came up with a tiny music player. Unfortunately there is one problem.I've the following code:private static readonly object Locker = new object();private static volatile BitmapImage _defaultCover;...
1 Apr 2012 by maxhmreid
I also have this problem. In my case I am receiving data from a WiFi webcam.I have managed to improve it quite a bit by replacing a blocking network call for the async version, but the image still flickers like crazy.My networking call and bitmap generation only take around 5 milliseconds...
6 Dec 2009 by nav234
Hi,I need to select random checkboxes in a Tree view,which areretrived from Database (SQL Server).My project is windows based and using WPf. Im using VB.net and sql server database.Can anyone help on this issue ???Thanks in advanceRegardsnaveen...:~
22 Feb 2010 by Rahul P Nath
Hi,For this you can either use a property in your entity,say IsSelected,and bind the checkbox's(in the datatemplate of the treeviewitem) IsChecked property to it.Or get the datatemplate from the treeview item,which can be obtained using the ItemsContainerGenerator and set the IsChecked...
17 Jan 2012 by orreborresnorre
I have a question.I want to stuff a stackpanel(with items) into a listviewitem column/row. The rest of the columns on the same row are suposed to have text-content (maybe some icon too). How do i do this by code? Is it possible without having to trouble myself with too much XAML?thanks
17 Jan 2012 by Richard MacCutchan
The short answer is yes, anything you can do with XAML you can do with C#. Take a look at the ListView[^] class for examples.
6 Nov 2012 by Vijay hit
Hi, I am new to WPF. I have label control created in vb.net by wrapping on windows .net Label class. Now I want to migrate Label control from .net to WPF. I am facing a problem with below properties and like to find alternatives in WPF Label.AutoEllipse =...
6 Nov 2012 by Sergey Alexandrovich Kryukov
Please see my answer to the question. This is where you need to start:http://msdn.microsoft.com/en-us/library/system.windows.controls.label.aspx[^].Also consider using this UIElement as an...
8 Jun 2012 by mane0806
when i open dialog box to select audio file's everything except ".acc" can be seen and selected.. Following is my code.. { System.Windows.Forms.OpenFileDialog os = new System.Windows.Forms.OpenFileDialog(); os.Filter = "Audio...
8 Jun 2012 by Clifford Nelson
First of all, the code seems to work fine. Don't know what your problem is. I changed the file type I was looking for to ".cs" since I have no .acc. Also since you were bothering with the list of files (Filenames) instead of Filename, I set multiselect to...
20 Apr 2016 by Member 12473290
yep, sure: xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Height="350" Width="525">
20 Apr 2016 by Member 12473290
Hello!There are still many mistakes, it says that "the mesagebox does not exist in the current context.???
3 Nov 2014 by Praneet Nadkar
Hi,Lets suppose this is your class:public class Users{ public int ID { get; set; } public string UserName { get; set; } public string Email { get; set; } public string Password { get; set; } public Users(int id,string username, string email,string password)...
3 Nov 2014 by SpengergasseBiomedicin
My Question is how I can save usernames and passworts in a .csv data and by a input of the user check if there is a passwort and username in the .csv data like the one that the user just has entered right now? In C#(WPF, Visual studio)!
3 Apr 2024 by Member 16235801
I'm encountering the error ".dll targeting 'AMD64' is not compatible with the project's target platform 'x86'" while building my project in visual studio 2019. What I have tried: Switched project target platform to x64 (if applicable). Cleaned...
3 Apr 2024 by Pete O'Hanlon
First thing - try to run the project using Any CPU. See if that fixes it for you. If it doesn't, you will need to create an AMD64 specific configuration. From the menu, select Build > Configuration Manager. Select the Active Solution Platform...
3 Apr 2024 by OriginalGriff
To add to what Pete has said, x86 projects build for a 32 bit OS, while AMD64 are built for a 64 bit environment - you can't combine the two in a single executable as the CPU can't be switched between them at run time. So if you want to use a 64...
20 Dec 2013 by kingsa
Hi, I have created wpf application and i have added new .mdf file, but the file storing data permanently like as normal database,it stores temporarly,when application closes it loses all data , i want to install into client application what are precautions i need to take to ssave data...
17 Jun 2009 by Sacha Barber
This is a rant about .NET 3.5 SP1 StringFormat Binding Property
1 Aug 2023 by Fydobas
Say I have a WinForms application that I want to port to WPF/.NET 5.0 - or 6.0, it doesn't matter in this case. Also say I am required to use a certain third party library that is used for sending data to another application via a SOAP service....
19 Aug 2021 by Matt T Heffron
I have a .NET Framework WPF app that I've installed on a VM. (Installer built with WiX.) If I try to launch it, it fails without ever showing any UI. From the Event Viewer I can see that the problem is a FileNotFoundException: Application:...
19 Aug 2021 by Wendelius
One place to look is Windows Event Log. If the linked assembly cannot be found during startup, you should find the assembly name in the log.
19 Aug 2021 by Richard Deeming
It's possible that the exception is being thrown when your App file is loaded, which means your OnStartup method won't be called. Try giving your application a custom entry point in a separate class, and wrapping that in an exception handler...
25 Mar 2012 by habiya
mobile applications made in .net supports windows os? Can we develop a mobile application in .net that supports any os?
25 Mar 2012 by Uday P.Singh
Read these:targeting-developing-for-multiple-mobile-platforms-with-one-programming-language[^]Developing Android Applications in .NET[^]hope it helps :)
26 Mar 2012 by Amir Mahfoozi
I think Firemonkey Platform[^] which is shipped with Embarcadero RAD Studio XE2[^] will help you.http://edn.embarcadero.com/article/images/41566/RAD_Studio_XE2_Feature_Matrix.pdf[^]http://edn.embarcadero.com/article/images/41560/RADStudio_XE2_datasheet.pdf[^]Hope it helps.
7 Jan 2022 by Viken Patel
I am trying to create a RDLC report in WPF. My .NET Framework version is .NET Core 3.1. Can you help me with this? While adding data source, I get an error Error Screenshot What I have tried: I have tried to build with x86 but still not...
7 Jan 2022 by Dave Kreskowiak
That error means you're trying to call a method or get/set a property on a object that is null, meaning that object doesn't exist. You haven't shown the code that's throwing the error, so this is about the most you're going to get for an answer....
26 Oct 2020 by Matteo Prosperi
In this article, we investigate how DateTime issues are avoided.
11 Apr 2015 by Ziya1995
1. .NET Framework Class Library[^]2. .NET for Windows Store apps APIs[^]The question:How much is '2' stronger than '1'?I wanna choose WPF or '2' to make apps, but i see '2' APIs and feel like poor about it.I need rich user interface, smooth animations and so on.I like '2',...
12 Apr 2015 by Kornfeld Eliyahu Peter
There is not much to compare the two... .NET for Windows Store Applications is subset (mostly) of the full .NET framework and it has a specific goal - to develop applications for Windows Store...As not all platforms (of Windows) can run a Windows Store application, you should decide what are you...
13 Apr 2015 by Ziya1995
You use the subset of .Net Framework called .Net for Windows Store apps to bring C# functionality to Windows Runtime.Windows Runtime (WinRT) is unmanaged, but C# is managed, how?You use .Net for Windows Store apps types along with WinRT types and during execution .Net will interop with...
10 Jan 2011 by rajesh_ncc
Hi,This is Rajesh Kumar K. from Chennai based company.I am working with .net framework 2.0.I am very new to .net framework 4.0. Could you please guide me to a tutorial or sample or guide or notes. Thanks for your future help.regards,Rajesh Kumar K.
29 Dec 2010 by #realJSOP
No. That subject is way to broad to be answered here. The best thing you can do is develop some initiative and google ".Net 4.0". There are MILLIONS of results awaiting your perusal.
29 Dec 2010 by Hiren solanki
Yes why not ?See the big tutorial HERE[^]
29 Dec 2010 by Abhinav S
Go to the msdn website - you should get some real good videos and quickstarts there.
10 Jan 2011 by Anupama Roy
Take a look at this to know about Optional Parameters & Some New features in .Net 4.0http://dotnetforyou.wordpress.com/category/net/net4-0/[^]
19 Jul 2020 by rameshk553
Is there any SQLite DDEX provider package available for Visual studio 2019? I've tried to add ADO.NET Entity Data Model item to my WPF project, it was not listing SQLite data provider in the "Choose Data Source" dialog box to create a data...
18 Jul 2020 by Richard MacCutchan
System.Data.SQLite: Home[^]
19 Jul 2020 by Sandeep Mewara
Hi, It looks like you have used Nuget packages. They are for your application and not to provide a provider. As far I am aware (did a quick Google too), believe there is no official DDEX provider package for VS 2019. Seems you can try the...
12 May 2014 by Brad Joss
[RegSave] your property to the Registry, and more.
8 May 2013 by koleraba
HiI have a more theoretical than a "hands on" question regarding the "design-time" data for WPF applicatons which use the MVVM pattern. Lately I use two kinds of view-models in my applications. The "runtime" view-models which are used at runtime and "design-time" view-models which are...
8 May 2013 by _Maxxx_
Interesting question.I'm not a big IOC user so what I offer may not be applicable.in my mvvm 'framework' my design time data (essentially view models) inherit from the run time view models.I initially put them in the view project with the views - but I just had a quick try and moved...
8 May 2013 by Mohammed Hameed
Hi,,,I support your last solution only because I think thats the most effective one in your scenario.I suggests you to give it a name something like XYZ.Common (instead of XYZ.Interfaces). By this I mean dont tie it only for defining Interfaces but also other types as well which are meant...
12 Oct 2023 by Graeme_Grant
.NET compliant Silent ClickOnce Update Background Worker Service for Winform, WPF & Console in C# & VB
14 Apr 2021 by Tobynate
I am trying to open the file dialog in my WPF application which is a .Net Core app and uses a .Net Standard Library where all my code lives. However, when I tried the OpenFileDialog() method which inherits from Microsoft.Win32 namespace, it says...
14 Apr 2021 by Richard Deeming
Looking at the "Applies to" section in the documentation, this dialog was never defined for .NET Standard: OpenFileDialog Class (Microsoft.Win32) | Microsoft Docs[^]: Applies to: .NET 5.0, 6.0 preview 3 .NET Core 3.0, 3.1 .NET Framework...
19 Apr 2012 by Jani Giannoudis
Concepts and patterns for the handling of strings in multilingual applications.
7 May 2010 by Josué Yeray Julián Ferreiro
One thing that has changed from Windows Forms to WPF is the way we bind our controls to our sources of data and show them to the user.
10 Feb 2013 by εїзεїзεїз
Thanks in advanceI want to make an application which will draw shapes according to user entered dimension (width , Height), then user can place it on the form according to hiswish(he can drag/move left , right or top/bottom) with the mouse with 1/2 D interaction.Need advice that i...
10 Feb 2013 by OriginalGriff
Yes it's possible in winforms:I would start by creating a UserControl called Shape which draws itself via it's Paint event - you can then set it's location, size and width and so forth from outside, and handle its Resize event to cause a redraw by calling the Invalidate method.You then...
13 Jul 2010 by Alan Beasley
The WC Door button, covering all the missing skills needed to create the buttons shown in my first tutorial. As well as all 10 buttons for download!
20 Feb 2014 by Sacha Barber
WPF: Version II of my 100% Reflective class diagram creation tool.
9 Oct 2017 by Prabhanjant
Use timer control. see here Timer in WPF[^]
6 Mar 2013 by Member 9789638
Hi,i'm developing virtual clothes application, where clothes are mapped on a person body from video feed (possible to use video directly from webcam). I have all body detection/tracking sorted, the only difficulties I have are with clothes animation. I currently have 2D shirt to which I've...
15 Jan 2014 by Member 8125377
Hello,I would like to do the following:Let's say I'd like to switch into a mode like in iOS 7 I do by double-clicking the home-button where I can swipe between open apps, on windows 8 mobile I do it by holding the 'back' arrow for a while respectively.On a normal touch display I'd...
18 Nov 2013 by rahuls1
hii have created the two arm and both are connected but when i am rotating the first arm the second arm connected to it should rotate along with the first arm but it is not happening please help me out ..on this...
19 Nov 2013 by Alexanbu
Zam3d is a great tool for converting 3D Models into Xaml. I highly recomend Petzold's book 3D Programming for Windows. There are also a ton of tutorials...
3 Jun 2013 by IND-CODENAME-47
HI All,I have a requirement on urgent basis. I need to cut a 3D cube along x and y directions.Suppose that i have a cube of certain dimension and have 3 text boxes representing X,Y and Z direction. Now When i put any values in X and Y according to that the main 3D cube gets bisect.For...
27 Jun 2014 by Member 10911218
If only draw cube,it's easy,you can use OpenGl.If draw cube and flat text. you can use OpenGl and freetype to do it.If you don't know about the OpenGl or DirectX 3D ,then you can use the 3D controls, such as: EWDraw 3D ActiveX
6 Apr 2015 by QutaibaMustafa
Hi ^_^ I want to make a 3d painter using c#.First of all I want to display 3 panels - XY, XY and YZ Views. The user will paint what he wants in each panel. After that he will click on a button to combine the 3 views and get a 3d model from these panel. He also can render this model...
14 Apr 2015 by Gokulprasad05
Triangle FarPlaneDistance="100" LookDirection="-12,-11,-10" UpDirection="0,1,0" NearPlaneDistance="1" Position="11,10,9" FieldOfView="75" /> ...
19 Mar 2022 by Yang Kok Wah
A tool to generate face images and animated gif files for different angles and lighting using only a single face image. Also includes Face Matcher using Microsoft Face API.
20 Sep 2006 by Dragos Sbirlea
Have you ever imagined having 3D objects float on your desktop? Lets see how we can achieve such a result using only C# and WPF.
13 Sep 2011 by steersteer
Thank you very much for your response. I am thinking of developing a small game. will learn XNA soon.
26 Jun 2011 by DaveAuld
XNA is a effectively a Game engine XNA Wiki[^]WPF is Windows Presentation Foundation WPF Wiki[^]Check out the articles on CodeProject, for example, here is a WPF 3D Primer[^], there are plenty other ones.So, for 3D, WPF certainly is an option :)
12 Dec 2011 by ge-force
It depends on what you want to do in your game.WPF is better for small games, because you get all the controls that you can put down on your Window without having to custom-make controls.XNA, however, cna do some amazing stuff.Here are a few games by XNA:Robot Game (3rd person 3D...
17 Mar 2011 by NileshKRathod
Hello Friends, I am developing an application for LED cube. It is a WPF application, in this application I need to get x, y and z coordinates of 3D image.I have a picture box and in this picture box i take a 3D image as input and want to get x, y, and z coordinates of 3d image...
17 Mar 2011 by Abhinav S
This[^] may help you.
4 Jun 2012 by MukeshSinha
Hi,I have master 3d image and i want to set at run time another image as a label on master image. How can i do in WPF application. Please help me......
4 Jun 2012 by MuhtarQong
From your question, let's assume that you have two images:1. Please try this code(1) One is master (baseImage )image(2) The other one is, Label image (topImage)First, please overlay the topImage on the baseImage. If you need to show both images, set the transparency to lower value....