form 的詳細屬性問題!? 有關 抬頭 |
答題得分者是:jow
|
kyoti
一般會員 發表:3 回覆:7 積分:2 註冊:2008-03-02 發送簡訊給我 |
|
ikk
尊榮會員 發表:4 回覆:413 積分:768 註冊:2003-06-30 發送簡訊給我 |
通常都是自行繪製一個圖片, 程式只顯示此一圖片的外圍區域.
使用關鍵字去搜查尋文章吧, [code cpp] void __fastcall TForm1::FormCreate(TObject *Sender) { HRGN rethRgn; rethRgn=CreateRoundRectRgn(0,0,Form1->Width,Form1->Height,50,50); //圓角矩形 SetWindowRgn(Form1->Handle,rethRgn,True); } [/code]
------
FPGA驗證, FPGA開發平台, http://smims.com |
kyoti
一般會員 發表:3 回覆:7 積分:2 註冊:2008-03-02 發送簡訊給我 |
|
jow
尊榮會員 發表:66 回覆:751 積分:1253 註冊:2002-03-13 發送簡訊給我 |
|
kyoti
一般會員 發表:3 回覆:7 積分:2 註冊:2008-03-02 發送簡訊給我 |
|
hipig
高階會員 發表:31 回覆:75 積分:111 註冊:2007-01-15 發送簡訊給我 |
|
kyoti
一般會員 發表:3 回覆:7 積分:2 註冊:2008-03-02 發送簡訊給我 |
|
jow
尊榮會員 發表:66 回覆:751 積分:1253 註冊:2002-03-13 發送簡訊給我 |
程式起始載入畫面
謹供參考... [code delphi] program Test057; uses Forms, fMain in 'UNIT\fMain.pas' {frmMain}, fSplash in 'UNIT\fSplash.pas' {frmSplash}; {$R *.res} begin Application.Initialize; //frmSplash 宣告在 fSplash.pas frmSplash := TfrmSplash.Create(Application); //然後,在TfrmMain.OnActivate()時,關閉並釋放frmSplash Application.CreateForm(TfrmMain, frmMain); Application.Run; end. [/code] [code delphi] unit fMain; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs; type TfrmMain = class(TForm) procedure FormActivate(Sender: TObject); procedure FormCreate(Sender: TObject); private public end; var frmMain: TfrmMain; implementation uses fSplash; {$R *.dfm} procedure TfrmMain.FormCreate(Sender: TObject); var I: Integer; begin //Initial(模擬載入進度) if frmSplash <> nil then begin frmSplash.Gauge1.MinValue := 0; frmSplash.Gauge1.MaxValue := 99; for I := 0 to 99 do begin frmSplash.Gauge1.Progress := I; Application.ProcessMessages; Sleep(50); end; end; end; procedure TfrmMain.FormActivate(Sender: TObject); begin if frmSplash <> nil then begin frmSplash.Close; FreeAndNil(frmSplash); end; end; end. [/code] [code delphi] unit fSplash; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, Gauges; type TfrmSplash = class(TForm) Gauge1: TGauge; procedure FormCreate(Sender: TObject); procedure FormPaint(Sender: TObject); public procedure DrawBackImage(fn: string); end; var frmSplash: TfrmSplash; implementation {$R *.dfm} procedure TfrmSplash.FormCreate(Sender: TObject); begin BorderStyle := bsNone; FormStyle := fsStayOnTop; Position := poScreenCenter; Gauge1.Top := ClientHeight - Gauge1.Height - 10; Show(); Update(); end; procedure TfrmSplash.FormPaint(Sender: TObject); begin DrawBackImage('C:\TEST.BMP'); end; procedure TfrmSplash.DrawBackImage(fn: string); var b: TBitmap; begin if FileExists(fn) then begin b := TBitmap.Create; try b.LoadFromFile(fn); Canvas.Lock; try Canvas.StretchDraw(ClientRect,b); finally Canvas.Unlock; end; finally FreeAndNil(b); end; end; end; end. [/code] 程式碼下載: http://delphi.ktop.com.tw/download.php?download=upload/47e31382e8f2f_Test057.zip 啊! 弄錯工具了!! >''<
編輯記錄
jow 重新編輯於 2008-03-21 09:54:33, 註解 啊! 弄錯工具了!! >''<‧
|
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |