什么是無效﹖是指在Visible := False嗎﹖請設Visible := True;
如果是在自動創建中移去﹐請將此子Form的Unit加入MDIMain中﹐然后﹕
var
mc:Tmdichildform;
begin
mc := Tmdichildform.create(self);
mc.show;//mc的close事件中﹕action := cafree;
end;
================
1.在Form1上增加一个Image元件,并选择要设置的背景到Image的Picture中。 (MDIMAIN!!!!)
2:在Form1的Private中定义:
FClientInstance,
FPrevClientProc : TFarProc;
PROCEDURE ClientWndProc(VAR Message: TMessage);
3: 在实现(implementation)中加入上述过程的具体内容:
PROCEDURE TForm1.ClientWndProc(VAR Message: TMessage);
VAR
MyDC : hDC;
Ro, Co : Word;
begin
with Message do
case Msg of
WM_ERASEBKGND:
begin
MyDC := TWMEraseBkGnd(Message).DC;
FOR Ro := 0 TO ClientHeight DIV Image1.Picture.Height DO
FOR Co := 0 TO ClientWIDTH DIV Image1.Picture.Width DO
BitBlt(MyDC, Co*Image1.Picture.Width, Ro*Image1.Picture.Height,
Image1.Picture.Width, Image1.Picture.Height,
Image1.Picture.Bitmap.Canvas.Handle, 0, 0, SRCCOPY);
Result := 1;
end;
else
Result := CallWindowProc(FPrevClientProc, ClientHandle, Msg, wParam, lParam);
end;
end; 4:在Form1的创建事件中加入:
FClientInstance := MakeObjectInstance(ClientWndProc);
FPrevClientProc := Pointer(GetWindowLong(ClientHandle, GWL_WNDPROC));
SetWindowLong(ClientHandle, GWL_WNDPROC, LongInt(FClientInstance)); 上面的步骤已经完成了MDI主窗口背景图案的设置,下面可以增加一个MDIChild窗口,实现MDI程序。
如果是在自動創建中移去﹐請將此子Form的Unit加入MDIMain中﹐然后﹕
var
mc:Tmdichildform;
begin
mc := Tmdichildform.create(self);
mc.show;//mc的close事件中﹕action := cafree;
end;
================
1.在Form1上增加一个Image元件,并选择要设置的背景到Image的Picture中。 (MDIMAIN!!!!)
2:在Form1的Private中定义:
FClientInstance,
FPrevClientProc : TFarProc;
PROCEDURE ClientWndProc(VAR Message: TMessage);
3: 在实现(implementation)中加入上述过程的具体内容:
PROCEDURE TForm1.ClientWndProc(VAR Message: TMessage);
VAR
MyDC : hDC;
Ro, Co : Word;
begin
with Message do
case Msg of
WM_ERASEBKGND:
begin
MyDC := TWMEraseBkGnd(Message).DC;
FOR Ro := 0 TO ClientHeight DIV Image1.Picture.Height DO
FOR Co := 0 TO ClientWIDTH DIV Image1.Picture.Width DO
BitBlt(MyDC, Co*Image1.Picture.Width, Ro*Image1.Picture.Height,
Image1.Picture.Width, Image1.Picture.Height,
Image1.Picture.Bitmap.Canvas.Handle, 0, 0, SRCCOPY);
Result := 1;
end;
else
Result := CallWindowProc(FPrevClientProc, ClientHandle, Msg, wParam, lParam);
end;
end; 4:在Form1的创建事件中加入:
FClientInstance := MakeObjectInstance(ClientWndProc);
FPrevClientProc := Pointer(GetWindowLong(ClientHandle, GWL_WNDPROC));
SetWindowLong(ClientHandle, GWL_WNDPROC, LongInt(FClientInstance)); 上面的步骤已经完成了MDI主窗口背景图案的设置,下面可以增加一个MDIChild窗口,实现MDI程序。
解决方案 »
- delphi 自己做密码框,如何做出像QQ一样显示圆点?
- 请帮我解释一下程序的意思
- 我这样理解对吗?
- Excel模板问题!!!!!!!!!!!!
- 谁能帮助我? mts/com+多层开发遇到问题......
- ADO连接Access2000数据库,由于机器上装的是Access97,Access的驱动是3.5,怎么才能添加4.0呢?
- 诚心请教大家(Delphi 的web应用的一个问题)
- !#!还有人知道把小数转化为百分数的函数吗?
- abc6d6c 是最好的包,大家快找,下。
- 请问谁是用DELPHI做ASP组件的,请帮忙看看....Thanks
- 假如.................
- 在delphi5中任何取到sql中print出来的消息?
你的方法很好,但能否把.BMP图片换成.GIF文件呢?
画一幅GIF或jpg图片。
//showmessage(inttostr(Image1.Picture.Width));
?FOR Co := 0 TO ClientWIDTH DIV Image1.Picture.Width DO
BitBlt(MyDC, Co*Image1.Picture.Width, Ro*Image1.Picture.Height,
Image1.Picture.Width, Image1.Picture.Height,
Image1.Picture.Bitmap.Canvas.Handle, 0, 0, SRCCOPY);
Result := 1;
end;
过不去,提示除数是0,错误在?那行,可我显示的时候除数不是0阿