--- JvTransparentButton.pas.orig	2004-03-18 12:06:04.000000000 -0800
+++ JvTransparentButton.pas	2004-03-18 12:15:26.000000000 -0800
@@ -85,20 +85,21 @@
     procedure SetFrameStyle(Value: TJvFrameStyle);
     procedure SetTransparent(Value: Boolean);
     procedure SetBorderWidth(Value: Cardinal);
     procedure GlyphChanged(Sender: TObject);
   protected
     procedure AddGlyphs(aGlyph: TBitmap; AColor: TColor; Value: Integer);
     procedure PaintButton(Canvas: TCanvas); override;
     procedure PaintFrame(Canvas: TCanvas); override;
     procedure DrawTheText(ARect: TRect; Canvas: TCanvas); virtual;
     procedure DrawTheBitmap(ARect: TRect; Canvas: TCanvas); virtual;
+    procedure RepaintBackground; override;
     procedure ActionChange(Sender: TObject; CheckDefaults: Boolean);override;
     function GetActionLinkClass: TControlActionLinkClass; override;
   public
     constructor Create(AOwner: TComponent); override;
     destructor Destroy; override;
     property Canvas;
   published
     property Action;
     property Align;
     property AutoGray: Boolean read FAutoGray write SetAutoGray default True;
@@ -412,20 +413,21 @@
 constructor TJvTransparentButton.Create(AOwner: TComponent);
 begin
   inherited Create(AOwner);
   AllowAllUp := True;
   FNumGlyphs := 1;
   FAutoGray := True;
   FShowPressed := True;
   FOffset := 1;
   FBorderSize := 1;
   FTransparent := True;
+  ControlStyle:= ControlStyle - [csOpaque];
 
   FImList := TImageList.Create(self);
   FGlyph := TBitmap.Create;
   FGrayGlyph := TBitmap.Create;
   FDisabledGlyph := TBitmap.Create;
   FGlyph.OnChange := GlyphChanged;
 
   FNumGlyphs := 1;
   FSpacing := 2;
   FTextAlign := ttaCenter;
@@ -510,20 +512,24 @@
     Flat := FOutline = fsExplorer;
     Invalidate;
   end;
 end;
 
 procedure TJvTransparentButton.SetTransparent(Value: Boolean);
 begin
   if FTransparent <> Value then
   begin
     FTransparent := Value;
+    if FTransparent then
+      ControlStyle:= ControlStyle - [csOpaque]
+    else if not Flat then
+      ControlStyle:= ControlStyle + [csOpaque];
     Invalidate;
   end;
 end;
 
 procedure TJvTransparentButton.SetBorderWidth(Value: Cardinal);
 begin
   if FBorderSize <> Value then
   begin
     FBorderSize := Value;
     Invalidate;
@@ -823,20 +829,27 @@
       InflateRect(HelpRect, -BorderWidth - 1, -BorderWidth - 1);
       Canvas.Brush.Bitmap := Pattern;
       Self.Canvas.FillRect(HelpRect);
     end;
 
     ImageList_DrawEx(Handle, Index, Canvas.Handle, ARect.Left, ARect.Top, 0, 0,
       clNone, clNone, ILD_TRANSPARENT);
   end;
 end;
 
+procedure TJvTransparentButton.RepaintBackground;
+begin
+  if Transparent then
+    ControlStyle:= ControlStyle - [csOpaque];
+  inherited;
+end;
+
 procedure TJvTransparentButton.GlyphChanged(Sender: TObject);
 var
   GlyphNum: Integer;
 begin
   Invalidate;
   GlyphNum := 1;
   if (Glyph <> nil) and (Glyph.Height > 0) then
   begin
     if Glyph.Width mod Glyph.Height = 0 then
     begin
