August 11, 2007
During testing of my incrememting textbox that functions like the one in Microsoft Blend, I had on occasion noticed a fly in the ointment. What would happen was that the textbox would continue to increment even though the mouse was no longer down or near the textbox in question.
This morning I’m reading from Charles Petzold’s book, “Applications = Code + Markup” and was reading about the CaptureMouse method on UIElements. Turns out, this method is exactly what I need to ensure that textbox functions correctly.
You can download the updated code in the below presentation.
The basic problem was that under certain circumstances, the textbox was not receiving the OnMouseUp event. This is the event where all clean up was being done.
So to ensure clean up always gets performed, I’ve added in the counter part to CaptureMouse which is OnLostMouseCapture. By placing clean up code in OnLostMouseCapture, I ensure that the textbox clean up routines always run, even if the control never receives the OnMouseUp event.
Have a great day,
Karl
Just a grain of sand on the worlds beaches.
Leave a Comment » |
Expression Blend, Presentations, WPF Controls |
Permalink
Posted by Karl Shifflett
August 8, 2007
Presentation Materials From Columbia Enterprise Developers GUILD Meeting 8-8-2007
The below down load contains :
1. The Blend presentation PowerPoint
2. Hello World A La Blend code and program
3. VB.NET Win Forms Take Home Pay Calculator application (this was used as the model for the WPF application)
4. Updated WPFTaxCalculator code and program
YOU MUST - after using the below link to download the file, you MUST change the extenstion to .zip. This is a requirement of WordPress.com.
Blend Presentation Materials From Columbia SC Updated 11 Aug 2007
Cool Features In The WPF Tax Calculator Program
1. Custom textbox that increments it’s value using the mouse just like Microsoft Expression Blend.
2. The coolest tooltip. (Code shows you how to databind inside a resource back to the parent control that spawned the tooltip!)
3. Data binding to a .Net 1.1 .dll by wrapping the class to conform to the WPF model for UI notification of property changes.
4. A fully reusable Formatting Converter. Handles all .Net formatting codes for fields. Super easy to use in WPF UI.
5. Using Enum element names to populate the combo boxes.
6. Two result charts displayed in 3D space.
I learned so much about WPF and Blend while preparing this presentation.
Have a great day,
Karl
Just a grain of sand on the worlds beaches.
Leave a Comment » |
Data Binding, Expression Blend, Presentations, WPF Controls |
Permalink
Posted by Karl Shifflett