Helpful Hint: Listbox-Font

Somtimes it might be useful to have fixed-pitch font in your Listbox.

One way to accomplish this is to use the System-Fixed-Font (at least
with Windows 3.11 -- what about Windows 95?)

The only thing you have to do is to set the font programmatically in
your form-create-routine.

Here's an example (where LB is the ListBox), where the font is set
after some strings have been added to the ListBox:


  for i := 0 to (SL.Count)-1 do
    LB.Items.Add(Copy(SL.Strings[i], 1, j-1));

  { !!!!! NOW SET THE DESIRED FONT !!!!! }
  { System_Fixed_Font or ANSI_Fixed_Font }
  SendMessage(LB.handle, wm_SetFont,
GetStockObject(System_Fixed_Font), 1);

Best Regards, N. Hartkamp

Klinik fuer Psychotherapie der Universitaet
P.O.Box 12 05 10
40605 Duesseldorf
Phone: +49-211-922-4722
FAX:   +49-211-922-4707 (office)
MBX:   N-HARTK...@NADESHDA.GUN.DE  (private)