有关MDI窗体大小的问题!

肥仔胧 2007-07-30 03:47:31
MDI窗体问题,主窗体FormStyle := fsMDIForm,其他子窗体均为fsMDIChild
问题来了,若打开的子窗体中有一个是最大化的,接着打开其他窗体也就跟着最大化了,
我想让各自的窗体打开时还是其在设计期间的大小,请问有办法解决吗?
...全文
222 23 打赏 收藏 转发到动态 举报
写回复
用AI写文章
23 条回复
切换为时间正序
请发表友善的回复…
发表回复
肥仔胧 2007-08-03
  • 打赏
  • 举报
回复
up
天行归来 2007-08-01
  • 打赏
  • 举报
回复
那可能需要去拦截一些消息,重载Form,做这方面处理。有空试试看。
肥仔胧 2007-08-01
  • 打赏
  • 举报
回复
--在窗口显示的时候,设置窗口大小即可。可通过配置或者直接在程序里设置。
当MDI子窗体有一个最大化时,其他打开的窗体都是跟着最大化的,当有一个窗体没有最大化时,其他已经最大化的窗体也会跟着变成没有最大化,这样一个窗体的状态就会破坏其他窗体的状态
天行归来 2007-08-01
  • 打赏
  • 举报
回复
在窗口显示的时候,设置窗口大小即可。可通过配置或者直接在程序里设置。
肥仔胧 2007-08-01
  • 打赏
  • 举报
回复
我的窗体都是ws_Mormal来显示的,
问题是,当我需要最大化的时候若改成align是会发生如下问题:窗体的关闭,还原,最小化按钮不见了
iuIRCClient 2007-08-01
  • 打赏
  • 举报
回复
你总结上面所有的回答,你的问题肯定能解决,好好想一下

你的要求:有些需要最大化,有些需要原始尺寸
你的问题:最大化的会影响其它原始尺寸窗体的状态

解决:所有窗体都按ws_normal来显示,就是原始尺寸
需要最大化的窗体程序改align或者设置尺寸,而不使用真正的最大化命令

你是不是想要人贴出来代码?
肥仔胧 2007-08-01
  • 打赏
  • 举报
回复
我也知道是WM_GETMINMAXINFO和WM_SYSCOMMAND,但....
ilove8 2007-08-01
  • 打赏
  • 举报
回复
WM_SYSCOMMAND
肥仔胧 2007-08-01
  • 打赏
  • 举报
回复
没错,是要拦截消息,就是不知道具体的做法
iuIRCClient 2007-07-31
  • 打赏
  • 举报
回复
上面不是说了么:把需要最大化的窗体align设为Client.让它的客户区填满client区域
肥仔胧 2007-07-31
  • 打赏
  • 举报
回复
我想要的效果是,当子窗体最大化时,标题栏不要最大化跟主窗体合并,也就是让子窗体最大化不填满区域的效果!
肥仔胧 2007-07-31
  • 打赏
  • 举报
回复
有没有人知道正航软件的,就是要那种效果啦
iuIRCClient 2007-07-31
  • 打赏
  • 举报
回复
如果所有窗体都需要设计时的大小的话,你就拦掉上面的最大化消息(或其它你想拦掉的消息)就行了啊。

如果你有时候想手动填满区域,你就程序设计align啊,别在设计时的属性里设置
肥仔胧 2007-07-31
  • 打赏
  • 举报
回复
align设为Client,有个问题,每次打开都变成填满区域,我要的是能保持在设计期间时的大小
iuIRCClient 2007-07-30
  • 打赏
  • 举报
回复
唉,其实我不过把delphi的help里的一段贴给你了而已。
肥仔胧 2007-07-30
  • 打赏
  • 举报
回复
先mark一下,有问题再通知你
iuIRCClient 2007-07-30
  • 打赏
  • 举报
回复
那就去搞吧。赫赫
肥仔胧 2007-07-30
  • 打赏
  • 举报
回复
没错,WM_SYSCOMMAND
iuIRCClient 2007-07-30
  • 打赏
  • 举报
回复
WM_SYSCOMMAND Notification

--------------------------------------------------------------------------------

A window receives this message when the user chooses a command from the Window menu (formerly known as the system or control menu) or when the user chooses the maximize button, minimize button, restore button, or close button.

Syntax

WM_SYSCOMMAND

WPARAM wParam
LPARAM lParam;

Parameters

wParam
Specifies the type of system command requested. This parameter can be one of the following values.
SC_CLOSE
Closes the window.
SC_CONTEXTHELP
Changes the cursor to a question mark with a pointer. If the user then clicks a control in the dialog box, the control receives a WM_HELP message.
SC_DEFAULT
Selects the default item; the user double-clicked the window menu.
SC_HOTKEY
Activates the window associated with the application-specified hot key. The lParam parameter identifies the window to activate.
SC_HSCROLL
Scrolls horizontally.
SC_KEYMENU
Retrieves the window menu as a result of a keystroke. For more information, see the Remarks section.
SC_MAXIMIZE
Maximizes the window.
SC_MINIMIZE
Minimizes the window.
SC_MONITORPOWER
Sets the state of the display. This command supports devices that have power-saving features, such as a battery-powered personal computer.
The lParam parameter can have the following values:

1 - the display is going to low power

2 - the display is being shut off

SC_MOUSEMENU
Retrieves the window menu as a result of a mouse click.
SC_MOVE
Moves the window.
SC_NEXTWINDOW
Moves to the next window.
SC_PREVWINDOW
Moves to the previous window.
SC_RESTORE
Restores the window to its normal position and size.
SC_SCREENSAVE
Executes the screen saver application specified in the [boot] section of the System.ini file.
SC_SIZE
Sizes the window.
SC_TASKLIST
Activates the Start menu.
SC_VSCROLL
Scrolls vertically.
lParam
The low-order word specifies the horizontal position of the cursor, in screen coordinates, if a window menu command is chosen with the mouse. Otherwise, this parameter is not used.
The high-order word specifies the vertical position of the cursor, in screen coordinates, if a window menu command is chosen with the mouse. This parameter is –1 if the command is chosen using a system accelerator, or zero if using a mnemonic.

Return Value

An application should return zero if it processes this message.

肥仔胧 2007-07-30
  • 打赏
  • 举报
回复
好像应该截取某个消息??有高手提示我的!
加载更多回复(3)

16,749

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 语言基础/算法/系统设计
社区管理员
  • 语言基础/算法/系统设计社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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