3D Buttons in easy steps

Hi,WPF stands for its flexibility in tweaking the look and feel of default controls. In this blog, I just portrait how to create a 3D button style.1. Create a button in Expression Blend and edit the default style as like below, 2. You can see the default style of Button, where you need to remove the... Continue Reading →

Finding Memory Leaks in WPF-based applications

There are numbers of blogs that folks wrote about memory leaks in Microsoft .Net Framework managed code and unmanaged code based applications. This blog,Show coding practices that can cause memory leaks which are more unique to WPF-base apps Share information about memory leaks in the .NET Framework; Show how to avoid these leaks Discuss the... Continue Reading →

C# Text Processing Function Library

String Functions in C#.NETC#.NET comes with a lot of great string processing functions like Substring, Compare, IndexOf. But the truth is the built-in .NET string functions are very limited. Programmers constantly have to rewrite similar text processing functions over and over.Luckily we can expand on them and create all kinds of C# advanced string functions.... Continue Reading →

Digging into user32.dll.

Most of the times, we need to interact with native windows actions in WPF or Win Forms. C# provides a better way to import an assembly dynamically and we can effectively use the methods of native System assembly.   class Example        {            // Use DllImport to import the Win32 MessageBox function.            [DllImport("user32.dll", CharSet = CharSet.Unicode)]            public static extern int MessageBox(IntPtr hWnd, String text, String caption, uint type);             static void Main()            {                // Call the MessageBox function using platform invoke.                MessageBox(new IntPtr(0), "Hello World!", "Hello Dialog", 0);            }        } One of the most useful assembly if user32 assembly which contains the 732 methods. ActivateKeyboardLayout... Continue Reading →

How to process waiting window messages during a loop?

The standard way of allowing Windows messages to be processed is to call Application.DoEvents method. However, the Application class in WPF does not have a DoEvents method. So, what you need is to find a way of calling this method, or an alternative method! Actually, it is surprisingly easy to do so: Instead of calling Application.DoEvents();you can call:System.Windows.Forms.Application.DoEvents();This will... Continue Reading →

Up ↑