Componentes - colocando caption em TWinControls |
Top Previous Next |
|
// Como adicionar um Caption aos componentes do tipo TWinControl
// We must not forget that this code will work only in a TWinControl components. // Well, first of all we must declear the procedure of CreateParams in the public section... // Then we go to work !!!
// Now you must add this line in the publised area if you wish to add some text to the caption:
property Caption;
// Now for the code part:
procedure TCaptionListBox.CreateParams(Params : TCreateParams); begin inherited CreateParams(Params); Params.Caption:= Caption; //We give the text that will displayed Params.Style := Style or WS_CAPTION; end; //End of the procedure
// Now we have a caption for our ListBox... And the funny part is that i read while back that // VB users payied mony for this kind of OCX component... :)
// Please feel free to comment |