(CodeLib-Manager)
Registriert seit: 10. Jun 2002
4.648 Beiträge
Delphi XE Professional
|
Re: Klick auf Caption einer Groupbox erkennen
22. Mai 2010, 18:05
Schwupps...
Delphi-Quellcode:
type
TMyGroupBox = class(TGroupBox)
public
property Canvas;
end;
procedure TForm1.GroupBox1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
var
myRect : TRect;
begin
with TMyGroupBox(Sender as TGroupBox) do
myRect := Rect(8, 0, 8 + Canvas.TextWidth(Caption), Canvas.TextHeight(Caption));
if PtInRect(myRect, Point(X, Y)) then ShowMessage('Click!')
end;
Thomas
|
|
Zitat
|