Technology Learning

导航

03 2010 档案

窗体显示在最上层
摘要:1.设置FormStyle 为fsStayOnTop2.调用Api函数前者本质上也是调用SetWindowPosBOOLHWND hWnd,//窗体的句柄HWND hWndInsertAfter,//显示在最上面还是其他,本例为HWND_TOPMOSTint X,int Y,//point..int cx,int cy,//sizeUINT uFlags);//..SetWindowPos(han... 阅读全文

posted @ 2010-03-29 23:20 浔阳渔夫 阅读(551) 评论(0) 推荐(0)

移动无标题栏窗口
摘要:procedure WMNChitTest(var Msg:TWMNChitTest);message WM_NCHITTEST;procedure TForm13.WMNChitTest(var Msg:TWMNChitTest);begininherited;if Msg.Result=htClient then//将客户区消息转换成拖动标题时产生的消息 Msg.Result:=htCapti... 阅读全文

posted @ 2010-03-29 23:01 浔阳渔夫 阅读(163) 评论(0) 推荐(0)

不可移动的窗体
摘要:procedure windowsposchange(var Msg:TWMWINDOWPOSCHANGING);message WM_WINDOWPOSCHANGING;var Form13: TForm13; // oleft:integer; otop:integer; owidth:integer; oHeight:integer;implementation{$R *.dfm}proce... 阅读全文

posted @ 2010-03-29 22:51 浔阳渔夫 阅读(267) 评论(0) 推荐(0)

(转)界面闪烁解决办法
摘要:1.防止刷新时闪烁的终极解决办法 [代码]2 Self.DoubleBuffered:=True; --------------------------------------------------------------- Self.DoubleBuffered:=True;/ScrollBox.DoubleBuffered:=True; //SelforparentisImage'spare... 阅读全文

posted @ 2010-03-28 23:54 浔阳渔夫 阅读(665) 评论(0) 推荐(0)

异常处理
摘要: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(... 阅读全文

posted @ 2010-03-26 17:21 浔阳渔夫 阅读(183) 评论(0) 推荐(0)

loadImage用法
摘要:pBitmap=LoadBitmap(hInstance,lpBitmapName) 这是加载资源中的Bitmap,而不是加载Bitmap文件。加载Bitmap文件,可以 用TBitmap: Graphics::TBitmap* Bmp = new Graphics::TBitmap; Bmp->LoadFromFile("d:\\a1.bmp"); Bmp->Handle 就是 HB... 阅读全文

posted @ 2010-03-26 12:41 浔阳渔夫 阅读(895) 评论(0) 推荐(0)

桌面滚动文字
摘要: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)... 阅读全文

posted @ 2010-03-25 22:09 浔阳渔夫 阅读(499) 评论(0) 推荐(0)

指针 问题
摘要: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... 阅读全文

posted @ 2010-03-25 13:53 浔阳渔夫 阅读(225) 评论(1) 推荐(0)

动态创建 listbox释放问题
摘要: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;... 阅读全文

posted @ 2010-03-25 10:28 浔阳渔夫 阅读(685) 评论(0) 推荐(0)

显示编辑框密码
摘要:if ToolButton1.Down then begin Edit1.Cursor:=crArrow; Edit1.Hint:=Edit1.Text; end else begin Edit1.Cursor:=crDefault; Edit1.Hint:=''; end; 阅读全文

posted @ 2010-03-24 23:37 浔阳渔夫 阅读(187) 评论(0) 推荐(0)

状态条中滚动文字
摘要: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... 阅读全文

posted @ 2010-03-24 22:54 浔阳渔夫 阅读(160) 评论(0) 推荐(0)

状态条中加入图像
摘要: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-... 阅读全文

posted @ 2010-03-24 22:39 浔阳渔夫 阅读(129) 评论(0) 推荐(0)

状态条中添加进度条
摘要:unit Unit6;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, ExtCtrls, StdCtrls, Mask, ComCtrls;type TForm6 = class(TForm) StatusBar1: TStatusBar; MaskE... 阅读全文

posted @ 2010-03-24 22:24 浔阳渔夫 阅读(278) 评论(0) 推荐(0)

修改窗口显示模式
摘要:在Object Inspector 中将窗口的BorderStyle值设为bsDialog窗口就不可以最大化最小化了... 阅读全文

posted @ 2010-03-24 21:28 浔阳渔夫 阅读(246) 评论(0) 推荐(0)

弹出菜单创建
摘要:procedure TForm1.Button1Click(Sender: TObject);varMainMenu:TMainMenu;MenuItem:TMenuItem;begin//创建主菜单对象,并设置主窗口的菜单为MainMenu对象MainMenu:=TMainMenu.Create(Self);Self.Menu:=MainMenu;//创建MainMenu主菜单的第一级菜单对象 ... 阅读全文

posted @ 2010-03-24 17:29 浔阳渔夫 阅读(353) 评论(1) 推荐(0)

五彩下拉框
摘要:unit Unit4;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;type TForm4 = class(TForm) ComboBox1: TComboBox; procedure ComboBox1DrawItem(Contr... 阅读全文

posted @ 2010-03-23 23:31 浔阳渔夫 阅读(184) 评论(0) 推荐(0)

五彩菜单
摘要: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... 阅读全文

posted @ 2010-03-23 23:19 浔阳渔夫 阅读(279) 评论(0) 推荐(0)

生成任务栏图标
摘要: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... 阅读全文

posted @ 2010-03-23 22:39 浔阳渔夫 阅读(367) 评论(1) 推荐(0)

Delphi工程运行的启动和退出画面
摘要://工程文件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... 阅读全文

posted @ 2010-03-23 21:36 浔阳渔夫 阅读(497) 评论(0) 推荐(0)