如何將GroupBox外面的框線隱藏起來? |
答題得分者是:pgdennis
|
darnell
版主 發表:25 回覆:103 積分:145 註冊:2003-03-04 發送簡訊給我 |
|
cashxin2002
版主 發表:231 回覆:2555 積分:1937 註冊:2003-03-28 發送簡訊給我 |
|
o.s
一般會員 發表:39 回覆:36 積分:15 註冊:2003-05-24 發送簡訊給我 |
|
pgdennis
資深會員 發表:41 回覆:526 積分:443 註冊:2002-05-23 發送簡訊給我 |
如果一定要用,用不想更改VCL,可以用一偷機的方式(參考以前Mickey兄PO的一篇文章)..不用重安裝 >)
< class="code">
//欺騙的重點QQ....
TGroupBox=class(stdCtrls.TGroupBox)
protected
procedure Paint; override;
end;
TForm1 = class(TForm)
GroupBox1: TGroupBox;
Panel1: TPanel;
RadioButton1: TRadioButton;
RadioButton2: TRadioButton;
RadioButton3: TRadioButton;
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
....
procedure TGroupBox.Paint;
var
Rect: TRect;
TopColor, BottomColor: TColor;
FontHeight: Integer;
Flags: Longint;
H: Integer;
R: TRect;
begin
Rect := GetClientRect;
Frame3D(Canvas, Rect, Color, Color, BorderWidth);
with Canvas do
begin
Font := Self.Font;
H := TextHeight('0');
if Text <> '' then
begin
if not UseRightToLeftAlignment then
R := Classes.Rect(8, 0, 0, H)
else
R := Classes.Rect(R.Right - Canvas.TextWidth(Text) - 8, 0, 0, H);
Flags := DrawTextBiDiModeFlags(DT_SINGLELINE);
DrawText(Handle, PChar(Text), Length(Text), R, Flags or DT_CALCRECT);
Brush.Color := Color;
DrawText(Handle, PChar(Text), Length(Text), R, Flags);
end;
end;
end;
永遠追不上技術更新的速度
------
星期一,二...無窮迴圈@@ |
leo2568
中階會員 發表:54 回覆:124 積分:70 註冊:2003-09-21 發送簡訊給我 |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |