ebmDevMag.com home
ebm Developer's Magazine
links

developer's mag
main page

article
part 1
part 2
part 3
part 4
part 5
part 6
part 7
part 8
part 9


2 - CLabel

The easiest way to provide text captions to your programs is with the CLabel object, which you just drop onto your form in the Form Editor, or add to your program by constructing an object in your code:
  CLabel(U16 id,const char *label,const FONT*font=0);
Because a label is rarely referred to by its id, it can be set to zero. As well, the CWindow's font is usually the font for the label, and so the default of zero is fine. This results in a simple call to create and add a label to a form:
  AddChild(new CLabel(0,"My Text"),x,y);
This adds the label to the form at position (x,y). Note that x and y refer to the top left corner of the label.

Previous Section
Next Section

Copyright © 2001-2006 ebmDevMag.com - Legal Notice