关于MDI程序的全屏幕问题。

yeah 2000-07-05 10:51:00
各位,请问如何能做到像WPS2000那样,在一个MDI程序中(Parent含有菜单、工具条),将一个含有TMEMO的子窗口做成全屏幕?
...全文
157 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
yeah 2000-08-13
  • 打赏
  • 举报
回复
既然没有更好的答案,干脆把分分了吧。
yeah 2000-07-06
  • 打赏
  • 举报
回复
很感谢Redice的回答,但是此方法在恢复时Child窗口因连续Resize(我跟踪了一下,多达8、9次,连续地最大小化、还原),所以基本上不可用。
我试了一下将MDI框架窗口中的TOOLBAR及菜单隐藏,并去掉标题栏,然后最大化,然后将Child窗口最大化,已达到了要求,不过Child窗口中如果TRichEdit中文字太多时,闪烁太严重,有没有办法解决?哪位做过这种活儿的请帖出来看一下。可以参考看看WPS2000的全屏幕切换,很干净。
fyje 2000-07-06
  • 打赏
  • 举报
回复
将该form设置为mdichild,windowstate设置为最大化,放入TMEMO,设置其align属性为alclient即可
redice 2000-07-06
  • 打赏
  • 举报
回复
呵呵,不想多讲。我做了一个简单的例子
ftp://ftp.cs.uestc.edu.cn/incoming/Program/fullScreen.zip
仅供参考;

//MDI FORM
unit Unit1;

interface

uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ComCtrls, ToolWin, Menus;

type
TForm1 = class(TForm)
MainMenu1: TMainMenu;
ToolBar1: TToolBar;
StatusBar1: TStatusBar;
ToolButton1: TToolButton;
ToolButton2: TToolButton;
file1: TMenuItem;
exit1: TMenuItem;
help1: TMenuItem;
about1: TMenuItem;
procedure ToolButton2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation
uses unit2;
{$R *.DFM}

procedure TForm1.ToolButton2Click(Sender: TObject);
begin
if form1.MDIChildCount>0 then
begin
(form1.ActiveMDIChild as Tform2).fullscreen(true);
end;
end;

end.

//MDI Child

unit Unit2;

interface

uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, ComCtrls;

type
TForm2 = class(TForm)
RichEdit1: TRichEdit;
procedure FormResize(Sender: TObject);
private
{ Private declarations }
public
procedure FullScreen(full:boolean);
{ Public declarations }
end;

var
Form2: TForm2;
wState:TWindowState;
Resized:boolean=false;

implementation

{$R *.DFM}

procedure TForm2.FullScreen(full:boolean);
begin
if full then
begin
wState:=WindowState;
FormStyle:=fsNormal;
WindowState:=wsMaximized;
Resized:=true;
end else
begin
Resized:=false;
FormStyle:=fsMDIChild;
WindowState:=wState;
end;
end;

procedure TForm2.FormResize(Sender: TObject);
begin
if resized then
begin
fullScreen(false);
end;
end;

end.

5,386

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧