C# – Insert Images and Hyperlinks into RichTextBox in WPF

Like the name of control, the RichTextBox inheriting from TextBox control, allows user to enter and edit text. However it also provides more advanced formatting features than the standard TextBox, for example inserting rich media objects like images and hyperlinks. The objects (text, images, hyperlinks…) can be assigned directly to the control or can be… Continue reading C# – Insert Images and Hyperlinks into RichTextBox in WPF

C#, WPF – Copy files with progress bar by CopyFileEx API

When we copy a lot of files to a folder we would like our program showing the copying progress with useful information, for example how does the copying run or how many file left to be copied. The managed function File.Copy does not allow us to monitor its process by providing any callback function. There… Continue reading C#, WPF – Copy files with progress bar by CopyFileEx API

Silverlight, WPF – ListBox Drag and Drop

During my development I need to implement the drag and drop feature in Silverlight. It’s pretty easy to make this feature work in Windows Form but it’s not simple to enable this feature on control in Silverlight. Therefore the developer team of Silverlight has developed a Silverlight toolkit to help us to alleviate our work.… Continue reading Silverlight, WPF – ListBox Drag and Drop

WPF – Use ZedGraph in WPF application

Maybe you already know about ZedGraph. ZedGraph is a set of classes, written in C#, for creating 2D line and bar graphs of arbitrary datasets http://sourceforge.net/projects/zedgraph/ . If you need some basic samples for using this library you can read a useful article at CodeProject http://www.codeproject.com/KB/graphics/zedgraph.aspx . However this library now only supports Windows Form… Continue reading WPF – Use ZedGraph in WPF application

C#, WPF – Hit Testing Example

When we create interactive 2D drawing applications in WPF, we can deal directly with the user’s interaction with the graphics objects using mouse event handlers. However, WPF provides powerful hit- testing for graphics objects through the static VisualTreeHelper.HitTest method. In order to use this advanced hit-testing feature, we need to create a callback. The VisualTreeHelper… Continue reading C#, WPF – Hit Testing Example