Welcome to WindowsClient.net | Sign in | Join

Articles

Sponsors





  • advertise here

June 2007 - Posts

MFC 8.0 and Windows Forms Integration, Part II
Part I of this series briefly looked at the history of MFC as a framework for writing Windows applications and how MFC developers had often been at a disadvantage compared to Visual Basic developers in the area of third-party control availability. It also looked at how MFC 8.0 allows Windows Forms controls to be used within an MFC application. This article builds on the integration story with a look at control placement and event handling, the MFC classes used for the Windows Forms integration, and the Windows Presentation Foundation, the new Windows UI framework formerly known as Avalon.
MFC 8.0 and Windows Forms Integration, Part I
Although Microsoft Foundation Classes (MFC) admittedly are not the future of rich client development frameworks, many companies have a huge investment in the technology and Microsoft continues to support MFC to ensure that it works well with Windows Forms today and Avalon in the future. The migration path from MFC to fully native applications is a slow one. Windows Forms lacks many of the advanced features of MFC, such as an in-built Document/View Framework and Windows shell integration, which prevents full migration for applications that rely on these features. Even if full framework feature parity existed, porting and testing an application from one framework to another is a massive job. For these reasons, having bridging technologies between the past (MFC) and the future (Windows Forms and Avalon) is very important. This first of two articles looks at MFC today, and shows how much easier MFC 8.0 makes Windows Forms integration. Part II will drill into the MFC classes that implement the integration, as well as offer a brief look ahead at integrating with Avalon.
Progress Disk
Progress disk is a simple control that looks like the one in SQL Server 2005. It can be used to replace the old progress bar with a nice and colorful mix of gradient colors.
Creating Custom WPF Controls
The advent of any new programming model generates a great deal of excitement, and the Windows Presentation Foundation (WPF) is no exception. This powerful UI framework provides a plush set of controls to construct rich user experiences. The controls provided within this coding quiver will help you hit the mark for the majority of your UI targets. Occasionally, you will come across a development requirement that you have not previously encountered. When this occurs, the need for a custom control may arise. A custom control generally involves melding a collection of standard controls together to address the needs of a specific task. Think of a custom control as one of the drag-and-drop UI components often used to develop ASP.NET and Windows Forms applications within Visual Studio. The primary benefit of creating a custom control is that it opens the door for reuse. The remainder of this article walks you through the process of creating a custom control within WPF. However, it is not meant to be an introduction to XAML or WPF. For an introduction to XAML and WPF, please refer to the Windows SDK documentation for .NET 3.0.
Add Simple Animations to Your WPF Application with Timelines
In the previous article of this series, I introduced you to WPF transformations. This article will continue to work with transformation, but also introduce timelines that help you create animations in your WPF applications.
Spelling Suggestions in a WPF TextBox
This article reviews a TextBox subclass which provides support for helping the user easily fix typos. The SmartTextBox extends WPF's built-in support for spellchecking by popping up a customizable list of "suggestions" for a misspelled word. The list of suggestions can be shown manually via the F1 key, or programmatically with one simple method call. When the list of suggestions is shown, its height is briefly animated to provide a subtle visual cue for the user.
Adventures into Ink API using WPF
I don't know a lot about you but I am becoming more and more interested in .NET 3.0 and in particular I am drawn to WPF. Up until now I have been mainly crafting my WPF apps such as this or this or this using a combination of Visual Studio 2005 with The Visual Studio Designer for WPF addon, or have been borrowing snippets of code from here and there (Mainly from Josh Smith actually, so thanks Josh if you're reading this), and piecing together a workable solution. Anyway for this article I decided to use Expression BLEND to see what I could create and just how easy it was.
Dot2WPF - a WPF control for viewing Dot graphs
I am presenting a WPF control for viewing graphs rendered by GraphViz (Dot). The DotViewer control has the usual navigation -- i.e. zoom, drag, scroll -- and supports hit testing on nodes, which is used for displaying tooltips. In the first place, this article should show you how easy it is to do "owner drawn graphics" in WPF. As it turns out, the viewer of this sample also has some advantages over existing viewers: - It is several times faster, probably because WPF is hardware accelerated - Because WPF works vector-oriented, zooming is fast and produces smooth, good looking pictures - Nodes can be found by mouse position, which makes user interactions possible (tooltips, selections) - You can easily integrate it into your own .NET applications - It works with huge graphs; for example 350 nodes with 2600 edges -- i.e. more than 53000 Bezier points -- can be displayed and zoomed nearly delay-free I suggest that you now download the sample and play with it a little before continuing.
Validation in Windows Presentation Foundation
Since the dawn of software development, the single biggest threat to reliable information has been end-users. After decades of the existence of computers, why do we still need to inform users that "the Start Date should always be less than the End Date", or that "First Name is a required field"? Since User.Current.Electrocute() won't be added to the .NET Framework until .NET 4.0, most of us generally have to resort to displaying some kind of UI cues to politely tell the user what they've done wrong, and how they can fix it. Under Windows Forms, we had the ErrorProvider, and under ASP.NET, we had Validator controls. In Windows Presentation Foundation, the approach is going to change, but the goal remains the same: telling users that something is wrong. In this article, I'll discuss how input validation is designed to be handled in Windows Presentation Foundation (hereafter referred to as WPF). Specifically, I'll discuss the ExceptionValidationRule class, creating custom ValidationRules, how to display errors, when to display errors (UpdateSourceTriggers), and finally, an alternative approach using an implementation of the Windows Forms ErrorProvider for WPF.
Creating and consuming a custom WPF control
Whenever a new technology comes along, I personally find that the best way to get to grips with its functionality is to try and create something you have done in another language. To this end, this article will describe how to create a custom control in WPF which will raise custom events. The custom control will then be placed with a standard XAML window and the custom control's events shall be subscribed to. That's it in a nutshell. But along the way there are several things that I would like to point out to you.
Using 2D controls in a 3D environment
When you first heard about the 3D possibilities of WPF, you probably thought that it's a great improvement. But then you discovered that the existing 2D controls become obsolete when you make the decision of using a 3D interface. The goal of this article is to explain the necessary steps you have to take in order to reuse the power of your existing controls in a 3D application. We will do this by example, building the 3D correspondent of a generic 2D listbox (by generic, we understand that the list elements can be any 2D control).
Advanced Custom TreeView Layout in WPF
In a previous article here on the CodeProject I demonstrated one way of redefining how a WPF TreeView can be displayed. In that article we examined how to make a TreeView look like an Org Chart by using some XAML magic. In this article we will explore a more complex and interactive customization, which makes the TreeView present its items as a set of "nested buckets."
The Ins and Outs of Dependency Properties and Routed Events in WPF
XAML, one of the most important pieces in the Windows Presentation Foundation (WPF) puzzle, is merely another way to describe your intent to the computer. In fact, the XAML you write can almost always be written in VB.NET or C#.
WPF 2D Transformations
In the previous articles of this series, I introduced the Windows Presentation Foundation (formerly code-named 'Avalon'), XAML (the new language for designing user interfaces), the Microsoft Expression family of tools (Graphic, Interactive, and Web Designers) and you created two versions of a simple calculator using these new technologies and tools. Starting with this article, you will start getting into more advanced and detailed topics concerning WPF, XAML, and the Interactive Designer.
Object-Oriented Concepts in .NET
This sample chapter is excerpted from Visual Basic Programmer's Guide to the .NET Framework Class Library, by Lars Powers and Mike Snell.
Next page »
Page view counter