How can I find out how wide a particular string of text is when it is shown using a particular font? I already figured out how to get the height, but the width seems much more elusive.

I used to be able to use TextWidth in VB6.