article

Migrating from Azure translation API version 2 to 3

Almost two years ago I wrote a post describing how to translate text using Azure cognitive services, however the API it uses is to be switched off and so I needed to migrate from the version 2 API to version 3. This post describes how I migrated my existing `TranslationClient` class.

avatar
Richard Moss
article

Getting a window rectangle without the drop shadow

A short article which describes how to get a window rectangle without including offsets for drop shadows

avatar
Richard Moss
article

Capturing screenshots using C# and p/invoke

I was recently updating some documentation and wanted to programmatically capture some screenshots of the application in different states. This article describes how you can easily capture screenshots in your own applications using the `BitBlt` Win32 API call.

avatar
Richard Moss
article

Announcing MantisSharp, a .NET client for using the MantisBT REST API

I've released a new open source project named MantisSharp, a simple .NET client for working with the recently introduced REST API for Mantis Bug Tracker.

avatar
Richard Moss
article

Translating text with Azure cognitive services

Some time ago, I used the Bing Translator API to help create localization for some of our products. As Microsoft recently retired the Data Market used to provide this service it was high time to migrate to the replacement Cognitive Services API hosted on Azure. This article covers using the basics of Azure cognitive services to translate text using simple HTTP requests.

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
article

Specifying custom text when using the LabelEdit functionality of a TreeView

An article which describes a robust yet simple way to have custom text when using the `LabelEdit` functionality of a `TreeView` and working around the limitations of Windows Forms using C# along with the `TVM_GETEDITCONTROL` and `WM_SETTEXT` messages.

avatar
Richard Moss
article

Adding a horizontal scrollbar to a ComboBox using C#

How to add a horizontal scrollbar to a ComboBox in C# using the WS_HSCROLL style and CB_SETHORIZONTALEXTENT message.

avatar
Richard Moss