I am trying to use System.Windows.Controls.TextChangedEventArgs
, but I cannot import System.Windows.Controls
. When I try to add a reference, System.Windows.Controls
is not one of the assemblies that I can select.
Does anyone know how to resolve the issue?
If you're using Visual Studio 2022 open the Project Properties and check the Windows. Forms - Enable Windows Forms for this Project setting. Save this answer.
Try typing "controls" in the search box (in the top right corner of the dialog box). System. Windows. Controls should appear in the list that's returned.
The accepted answer tells you the problem but does not tell you how to solve it.I'll just add this for future visitors.
To solve this problem, you need to add the reference to PresentationFramework.dll
.
1 Go to Solutions Explorer
(it's on the right of your IDE) > Right click on References
2 Select Add Reference
in the window that opens, look for Presentation Framework
, check the box and click okay. That's all. This is the way to add references to your project.
System.Windows.Controls
is a namespace that contains classes defined in PresentationFramework.dll
.
However, if you don't already have a reference to that assembly, you're probably doing something wrong.
Are you sure you're actually using WPF?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With