Index: JvDBHTLabel.pas
===================================================================
--- JvDBHTLabel.pas	(revision 10916)
+++ JvDBHTLabel.pas	(working copy)
@@ -49,7 +49,13 @@
     procedure SetDataSource(const Value: TDataSource);
     procedure DataChange(Sender: TObject);
     procedure SetMask(const Value: string);
+    procedure CMGetDataLink(var Message: TMessage); message CM_GETDATALINK;
   protected
+    function GetLabelText: string; override;
+    procedure Loaded; override;
+    procedure Notification(AComponent: TComponent;
+      Operation: TOperation); override;
+    procedure SetAutoSize(Value: Boolean); override;
   public
     constructor Create(AOwner: TComponent); override;
     destructor Destroy; override;
@@ -181,6 +187,11 @@
 
 //=== { TJvDBHTLabel } =======================================================
 
+procedure TJvDBHTLabel.CMGetDataLink(var Message: TMessage);
+begin
+  Message.Result := Integer(FDataLink);
+end;
+
 constructor TJvDBHTLabel.Create(AOwner: TComponent);
 begin
   inherited Create(AOwner);
@@ -214,6 +225,42 @@
   Result := FDataLink.DataSource;
 end;
 
+function TJvDBHTLabel.GetLabelText: string;
+begin
+  if csPaintCopy in ControlState then
+  begin
+    if (Assigned(FDataLink) and Assigned(FDataLink.DataSet)) then
+      Result := ReplaceFieldNameTag(FMask, FDataLink.DataSet)
+    else
+      Result := ReplaceFieldNameTag(Mask, nil);
+  end
+  else
+    Result := Caption;
+end;
+
+procedure TJvDBHTLabel.Loaded;
+begin
+  inherited;
+  if (csDesigning in ComponentState) then DataChange(Self);
+end;
+
+procedure TJvDBHTLabel.Notification(AComponent: TComponent; Operation: TOperation);
+begin
+  inherited;
+  if (Operation = opRemove) and (FDataLink <> nil) and
+    (AComponent = DataSource) then
+    DataSource := nil;
+end;
+
+procedure TJvDBHTLabel.SetAutoSize(Value: Boolean);
+begin
+  if AutoSize <> Value then
+  begin
+    if Value and FDataLink.DataSourceFixed then DatabaseError(SDataSourceFixed);
+    inherited;
+  end;
+end;
+
 procedure TJvDBHTLabel.SetDataSource(const Value: TDataSource);
 begin
   FDataLink.DataSource := Value;
Index: JvHtControls.pas
===================================================================
--- JvHtControls.pas	(revision 10916)
+++ JvHtControls.pas	(working copy)
@@ -922,7 +922,9 @@
 procedure TJvCustomHTLabel.Paint;
 var
   Rect: TRect;
+  PaintText: String;
 begin
+  PaintText := GetLabelText;
   Canvas.Font := Font;
   Canvas.Brush.Color := Color;
   if Transparent then
@@ -935,22 +937,22 @@
     tlTop:
       ;
     tlBottom:
-      Rect.Top := Rect.Bottom - ItemHTHeight(Canvas, Caption);
+      Rect.Top := Rect.Bottom - ItemHTHeight(Canvas, PaintText);
     tlCenter:
-      Rect.Top := (Rect.Bottom - Rect.Top - ItemHTHeight(Canvas, Caption)) div 2;
+      Rect.Top := (Rect.Bottom - Rect.Top - ItemHTHeight(Canvas, PaintText)) div 2;
   end;
   Canvas.Font.Style := []; // only font name and font size is important
   if not Enabled then
   begin
     OffsetRect(Rect, 1, 1);
     Canvas.Font.Color := clBtnHighlight;
-    ItemHTDraw(Canvas, Rect, [odDisabled], Caption);
+    ItemHTDraw(Canvas, Rect, [odDisabled], PaintText);
     OffsetRect(Rect, -1, -1);
     Canvas.Font.Color := clBtnShadow;
-    ItemHTDraw(Canvas, Rect, [odDisabled], Caption);
+    ItemHTDraw(Canvas, Rect, [odDisabled], PaintText);
   end
   else
-    ItemHTDraw(Canvas, Rect, [], Caption);
+    ItemHTDraw(Canvas, Rect, [], PaintText);
 end;
 
 procedure TJvCustomHTLabel.MouseMove(Shift: TShiftState; X, Y: Integer);
