摘要:1.设置FormStyle 为fsStayOnTop2.调用Api函数前者本质上也是调用SetWindowPosBOOLHWND hWnd,//窗体的句柄HWND hWndInsertAfter,//显示在最上面还是其他,本例为HWND_TOPMOSTint X,int Y,//point..int cx,int cy,//sizeUINT uFlags);//..SetWindowPos(han...
阅读全文
摘要:procedure WMNChitTest(var Msg:TWMNChitTest);message WM_NCHITTEST;procedure TForm13.WMNChitTest(var Msg:TWMNChitTest);begininherited;if Msg.Result=htClient then//将客户区消息转换成拖动标题时产生的消息 Msg.Result:=htCapti...
阅读全文
摘要:procedure windowsposchange(var Msg:TWMWINDOWPOSCHANGING);message WM_WINDOWPOSCHANGING;var Form13: TForm13; // oleft:integer; otop:integer; owidth:integer; oHeight:integer;implementation{$R *.dfm}proce...
阅读全文
摘要:1.防止刷新时闪烁的终极解决办法 [代码]2 Self.DoubleBuffered:=True; --------------------------------------------------------------- Self.DoubleBuffered:=True;/ScrollBox.DoubleBuffered:=True; //SelforparentisImage'spare...
阅读全文
摘要:bmp:=TBitmap.Create;// bmp.Handle:=LoadImage(HINSTANCE,'bmp1',IMAGE_BITMAP,0,0,0);//HINSTANCEtry bmp.LoadFromFile('testfas.bmp');except on EFOpenError do begin //ShowMessage('here'); bmp.LoadFromFile(...
阅读全文
摘要:pBitmap=LoadBitmap(hInstance,lpBitmapName) 这是加载资源中的Bitmap,而不是加载Bitmap文件。加载Bitmap文件,可以 用TBitmap: Graphics::TBitmap* Bmp = new Graphics::TBitmap; Bmp->LoadFromFile("d:\\a1.bmp"); Bmp->Handle 就是 HB...
阅读全文
摘要:procedure TForm10.FormCreate(Sender: TObject);beginBrush.Style:=bsclear;Fx:=0;end;procedure TForm10.Timer1Timer(Sender: TObject);var i1,i2:integer;begin //**** Form10.Visible:=false; //i1:=Random(800)...
阅读全文
摘要:var i,j:integer; pi,pj:^integer;//Pointer;begin i:=12; j:=23; New(pi); New(pj); pi^:=10; pj^:=23; { if pi<>nil then FreeMemory(pi); } DisPose(pi); pi:=nil; if pi=nil then ShowMessage('nil') else...
阅读全文
摘要:procedure TForm5.FormCreate(Sender: TObject);begin//********** ListBox1:=TListBox.Create(self); ListBox1.Parent:=self; ListBox1.Left:=100; ListBox1.Top:=100; ListBox1.Width:=400; ListBox1.Height:=400;...
阅读全文
摘要:if ToolButton1.Down then begin Edit1.Cursor:=crArrow; Edit1.Hint:=Edit1.Text; end else begin Edit1.Cursor:=crDefault; Edit1.Hint:=''; end;
阅读全文
摘要:with Statusbar1.Canvas do begin FillRect(DrawRect); Font.Color:=clBlack; w:=TextWidth('welcom to the Delphi interface...'); pen.Style:=psClear; Rectangle(DrawRect.Left,DrawRect.Top,DrawRect.Right,Draw...
阅读全文
摘要:Image1.Parent:=Statusbar1;Image1.Picture.Bitmap.LoadFromFile('book.bmp');Image1.Left:=DrawRect.Left+7;Image1.Top:=DrawRect.Top;Image1.Height:=DrawRect.Bottom-DrawRect.Top;Image1.Width:=DrawRect.Right-...
阅读全文
摘要:unit Unit6;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, ExtCtrls, StdCtrls, Mask, ComCtrls;type TForm6 = class(TForm) StatusBar1: TStatusBar; MaskE...
阅读全文
摘要:在Object Inspector 中将窗口的BorderStyle值设为bsDialog窗口就不可以最大化最小化了...
阅读全文
摘要:procedure TForm1.Button1Click(Sender: TObject);varMainMenu:TMainMenu;MenuItem:TMenuItem;begin//创建主菜单对象,并设置主窗口的菜单为MainMenu对象MainMenu:=TMainMenu.Create(Self);Self.Menu:=MainMenu;//创建MainMenu主菜单的第一级菜单对象 ...
阅读全文
摘要:unit Unit4;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;type TForm4 = class(TForm) ComboBox1: TComboBox; procedure ComboBox1DrawItem(Contr...
阅读全文
摘要:unit Unit4;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, Menus;type TForm4 = class(TForm) MainMenu1: TMainMenu; qwn: TMenuItem; S1: TMenuItem; A1: T...
阅读全文
摘要:unit Unit4;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs,ComCtrls,ExtCtrls,StdCtrls,ToolWin,ShellApi,Menus, jpeg; //define the consts const WM_MY_Not...
阅读全文
摘要://工程文件program Project1;uses Windows, Forms, Unit2 in 'Unit2.pas' {Form2}, Unit3 in 'Unit3.pas' {Form3};//Unit3 in 'Unit3.pas' {Form3};{$R *.res}begin Application.Initialize;//here... Form3:=TForm3.Cre...
阅读全文