刚才看了一下帮助,写的很清楚,还有例子:<br>procedure TForm1.FormCreate(Sender: TObject);<br><br>var<br> HeaderSection: THeaderSection;<br> I: Integer;<br>begin<br> for I := 0 to 4 do<br> begin<br> HeaderSection := HeaderControl1.Sections.Add;<br> HeaderSection.Text := 'Text Section ' + IntToStr(I);<br> HeaderSection.MinWidth := length(HeaderSection.Text) * Font.Size;<br> // Owner draw every other section<br> if (I mod 2 = 0) then<br> HeaderSection.Style := hsOwnerDraw<br> else<br> HeaderSection.Style := hsText;<br><br> end;<br>end;<br><br>procedure TForm1.HeaderControl1DrawSection(HeaderControl: THeaderControl;<br> Section: THeaderSection; const Rect: TRect; Pressed: Boolean);<br>begin<br> with HeaderControl.Canvas do<br> begin<br> // highlight pressed sections<br> if Pressed then<br> Font.Color := clRed<br> else<br> Font.Color := clBlue;<br> TextOut(Rect.Left + Font.Size, Rect.Top + 2, 'Owner Drawn text');<br><br> end;<br>end;