?? udrawedge.pas
字號:
unit UDrawEdge;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, ExtCtrls, checklst;
type
TForm1 = class(TForm)
Button1: TButton;
RadioGroup_Additional: TRadioGroup;
GroupBox1: TGroupBox;
CheckListBox2: TCheckListBox;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
type
TFlagsArray = array[0..18] of UINT; // holds an array of border type flags
const
{initialize the border flags array}
BorderFlags: TFlagsArray = (BF_ADJUST, BF_BOTTOM, BF_BOTTOMLEFT,
BF_BOTTOMRIGHT, BF_DIAGONAL,
BF_DIAGONAL_ENDBOTTOMLEFT,
BF_DIAGONAL_ENDBOTTOMRIGHT,
BF_DIAGONAL_ENDTOPLEFT, BF_DIAGONAL_ENDTOPRIGHT,
BF_FLAT, BF_LEFT, BF_MIDDLE, BF_MONO, BF_RECT,
BF_RIGHT, BF_SOFT, BF_TOP, BF_TOPLEFT,
BF_TOPRIGHT);
procedure TForm1.Button1Click(Sender: TObject);
var
TheRect: TRect; // defines the edge rectangle
Edge, Border: UINT; // holds the edge flag values
iCount: Integer; // a general loop counter
begin
{define the rectangle for the edge}
TheRect := Rect(21, 200, 216, 300);
{erase the last drawn edge}
Canvas.Brush.Color := clBtnFace;
Canvas.FillRect(TheRect);
{define the kind of edge}
case RadioGroup_Additional.ItemIndex of
0: Edge := EDGE_BUMP; //Combination BDR_RAISEDOUTER and BDR_SUNKENINNER
1: Edge := EDGE_ETCHED; //Combination BDR_SUNKENOUTER and BDR_RAISEDINNER
2: Edge := EDGE_RAISED; //Combination BDR_RAISEDOUTER and BDR_RAISEDINNER
3: Edge := EDGE_SUNKEN; //Combination BDR_SUNKENOUTER and BDR_SUNKENINNER
end;
{initialize the border flags}
Border := 0;
{determine the selected border type flags}
for iCount := 0 to 18 do
if CheckListBox2.Checked[iCount] then Border:=Border or BorderFlags[iCount];
{draw the edge}
DrawEdge(Canvas.Handle, TheRect, Edge, Border);
end;
end.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -