article

Displaying multi-page tiff files using the ImageBox control and C#

A brief article showing how to display individual pages from a multi-page tiff file in the ImageBox control.

avatar
Richard Moss
article

Aligning Windows Forms custom controls to text baselines using C#

One of the nice things about the Visual Studio WinForms designers are the guidelines it draws onto design surfaces, aiding you in perfectly positioning your controls. These guidelines are known internally as snap lines, and by default each visual component inheriting from `Control` gets four of these, representing the values of the control's `Margin` property. However, this default designer doesn't include an implementation for the `BaseLine` snap line, which is used to align controls via their contained text. This article shows how to create a custom designer to allow your controls to easily include this alignment option.

avatar
Richard Moss
article

Retrieving font and text metrics using C#

In several of my applications, I need to be able to line up text, be it blocks of text using different fonts, or text containers of differing heights. As far as I'm aware, there isn't a way of doing this natively in .NET, however with a little platform invoke we can get the information we need to do it ourselves as this short article demonstrates.

avatar
Richard Moss