“已解决”的问题依然有错,出现这种情况怎么办?

Wolfe 2003-01-21 09:19:13
http://expert.csdn.net/Expert/topic/1358/1358534.xml?temp=.8612329
如何限制可变大小窗口的缩小?通过resize处理如下:
Private Sub Form_Resize()
If Me.Width < 1000 Then
Me.Width = 1000
End If
End Sub
这样窗口无法最小化,怎么办呢?
...全文
78 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
remanwang 2003-01-23
  • 打赏
  • 举报
回复
Private Sub Form_Resize()
On Error Resume Next

If Me.Width < 1000 Then
Me.Width = 1000
End If
End Sub
Wolfe 2003-01-23
  • 打赏
  • 举报
回复
无奈小弟刚用VB,还不知如何截获Windows消息,我再看看再说吧
jxf_yx 2003-01-22
  • 打赏
  • 举报
回复
楼上的帮你问题解决了,怎么还不结分?
liangfang 2003-01-21
  • 打赏
  • 举报
回复
高手在场!我还显好了!
zyl910 2003-01-21
  • 打赏
  • 举报
回复
最好处理WM_GetMinMaxInfo消息


MSDN:



WM_GETMINMAXINFO
The WM_GETMINMAXINFO message is sent to a window when the size or position of the window is about to change. An application can use this message to override the window's default maximized size and position, or its default minimum or maximum tracking size.

WM_GETMINMAXINFO
lpmmi = (LPMINMAXINFO) lParam; // address of structure

Parameters
lpmmi
Value of lParam. Pointer to a MINMAXINFO structure that contains the default maximized position and dimensions, and the default minimum and maximum tracking sizes. An application can override the defaults by setting the members of this structure.
Return Values
If an application processes this message, it should return zero.

Remarks
The maximum tracking size is the largest window size that can be produced by using the borders to size the window. The minimum tracking size is the smallest window size that can be produced by using the borders to size the window.

QuickInfo
Windows NT: Requires version 3.1 or later.
Windows: Requires Windows 95 or later.
Windows CE: Unsupported.
Header: Declared in winuser.h.





MINMAXINFO
The MINMAXINFO structure contains information about a window's maximized size and position and its minimum and maximum tracking size.

typedef struct tagMINMAXINFO { // mmi
POINT ptReserved;
POINT ptMaxSize;
POINT ptMaxPosition;
POINT ptMinTrackSize;
POINT ptMaxTrackSize;
} MINMAXINFO;

Members
ptReserved
Reserved; do not use.
ptMaxSize
Specifies the maximized width (point.x) and the maximized height (point.y) of the window.
ptMaxPosition
Specifies the position of the left side of the maximized window (point.x) and the position of the top of the maximized window (point.y).
ptMinTrackSize
Specifies the minimum tracking width (point.x) and the minimum tracking height (point.y) of the window.
ptMaxTrackSize
Specifies the maximum tracking width (point.x) and the maximum tracking height (point.y) of the window.
QuickInfo
Windows NT: Requires version 3.1 or later.
Windows: Requires Windows 95 or later.
Windows CE: Unsupported.
Header: Declared in winuser.h.

zyl910 2003-01-21
  • 打赏
  • 举报
回复
Private Sub Form_Resize()
If me.WindowState=VbMinimized Then Exit Sub

If Me.Width < 1000 Then
Me.Width = 1000
End If
End Sub

7,763

社区成员

发帖
与我相关
我的任务
社区描述
VB 基础类
社区管理员
  • VB基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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