能看见 Panel 后面的控件,把Panel面板隐藏不就行了吗

解决方案 »

  1.   

    用右键点Panel,在弹出菜单里面选“Control|Send to back”
      

  2.   

    是这样的,我的 Panel 上还放有可视控件,要让 Panel 透明,使其背后的图片能看得见。我是在 Toolbar 上用的 Panel 控件, 它不能把 Toolbar 的背景图片给遮住了。
      

  3.   

    //这里给你贴一段flatpanel的代码给你procedure TFlatPanel.Paint;
    var
      memoryBitmap: TBitmap;
      textBounds: TRect;
      Format: UINT;
    begin
      textBounds := ClientRect;
      Format := DT_SINGLELINE or DT_VCENTER;
      case Alignment of
        taLeftJustify:
          Format := Format or DT_LEFT;
        taCenter:
          Format := Format or DT_CENTER;
        taRightJustify:
          Format := Format or DT_RIGHT;
      end;  memoryBitmap := TBitmap.Create; // create memory-bitmap to draw flicker-free
      try
        memoryBitmap.Height := ClientRect.Bottom;
        memoryBitmap.Width := ClientRect.Right;    // Draw Background
        if FTransparent then
          DrawParentImage(Self, memoryBitmap.Canvas)
        else
        begin
          memoryBitmap.Canvas.Brush.Color := Self.Color;
          memoryBitmap.Canvas.FillRect(ClientRect);
        end;    // Draw Border
    //    Frame3DBorder(memoryBitmap.Canvas, ClientRect, FColorHighlight, FColorShadow, 1);    // Draw Text
        memoryBitmap.Canvas.Font := Self.Font;
        memoryBitmap.Canvas.Brush.Style := bsClear;
        if not Enabled then
        begin
          OffsetRect(textBounds, 1, 1);
          memoryBitmap.Canvas.Font.Color := clBtnHighlight;
          DrawText(memoryBitmap.Canvas.Handle, PChar(Caption), Length(Caption), textBounds, Format);
          OffsetRect(textBounds, -1, -1);
          memoryBitmap.Canvas.Font.Color := clBtnShadow;
          DrawText(memoryBitmap.Canvas.Handle, PChar(Caption), Length(Caption), textBounds, Format);
        end
        else
          DrawText(memoryBitmap.Canvas.Handle, PChar(Caption), Length(Caption), textBounds, Format);    // Copy memoryBitmap to screen
        canvas.CopyRect(ClientRect, memoryBitmap.canvas, ClientRect);
      finally
        memoryBitmap.free; // delete the bitmap
      end;
    end;
      

  4.   

    你装一个flatstyle控件,里面的panel是可以透明的