then ControlStyle := ControlStyle + [csOpaque] else ControlStyle := ControlStyle - [csOpaque]; if DoPaletteChange and FDrawing then Update; end else ControlStyle := ControlStyle - [csOpaque]; if not FDrawing then Invalidate; end;
function THImage.CanAutoSize(var NewWidth, NewHeight: Integer): Boolean; begin Result := True; if not (csDesigning in ComponentState) or (Picture.Width > 0) and (Picture.Height > 0) then begin if Align in [alNone, alLeft, alRight] then NewWidth := Picture.Width; if Align in [alNone, alTop, alBottom] then NewHeight := Picture.Height; end; end;
procedure THImage.CMMouseLeave(var Message:TMessage); begin inherited; if FPicture<>FPictureNormal then Picture.Assign(FPictureNormal); end;
procedure THImage.CMMouseEnter(var Message: TMessage); begin inherited; if FPicture<>FPictureHot then Picture.Assign(FPictureHot); end;
procedure Register; begin RegisterComponents(''''Lee'''', [THImage]); end;