You are here

Subclassing of edit controls

I'll demonstrate the subclassing of edit controls using the example of a input control for frequency values.

The goal is to implement an input control that accepts only numbers and the units Hz, kHz and MHz as input and formats the input automagically. The input of "6000 h" should be formatted to "6 Khz", the input of "1234,567 k" should be formatted to "1.234567 MHz".