屏蔽最大化 你在属性里把 MaxButton 调为falsePrivate Sub Form_Resize()
Form1.ScaleMode = 3
If Form1.ScaleHeight >= 600 Or Form1.ScaleWidth >= 800 Then
Form1.ScaleHeight = 600
Form1.ScaleWidth = 800
End If
End Sub
Form1.ScaleMode = 3
If Form1.ScaleHeight >= 600 Or Form1.ScaleWidth >= 800 Then
Form1.ScaleHeight = 600
Form1.ScaleWidth = 800
End If
End Sub
解决方案 »
- 寻找QQ昵称为"毛毛"的VB程序员,我是QQ昵称为"勇感动欣"网友,你还记得吗?你在哪里啊!我找你好久了,:(...
- VB中如何取得汉字拼音首字母
- 显示DataReport报表时出现“该垂直方向不适合页"的信息?
- 怎样才能得到系统的物理内存和系统资源?
- inet不能连接到主机问题!!!
- 我信箱里经常收到“CSDN邮件期刊”,可不知道怎么阅读,
- 如果有两个datagrid,内容都一样,当我在一个datagrid中选中时,如何在另外的datagrid中也选中相应的行,并高亮显示
- qq自带的文件msg.db可不可以用VB打开?
- ……水晶报表的问题……
- access 数据库问题
- 有没有,判断记录集对象打开或关闭的东西呀!!!!给说说。谢了!~
- 数据库技术讨论-------------------第一帖
Private Declare Function SetWindowLong& Lib "user32" Alias "SetWindowLongA" (ByVal hWnd&, ByVal nIndex&, ByVal dwNewLong&)
Private Sub Form_Load()
procOld = SetWindowLong(hWnd, GWL_WNDPROC, AddressOf WindowProc)
End SubPrivate Sub Form_Unload(Cancel As Integer)
Call SetWindowLong(hWnd, GWL_WNDPROC, procOld)
End Sub以下是模块代码
Option ExplicitType POINTAPI
x As Long
y As Long
End TypePublic Const WM_GETMINMAXINFO As Long = &H24Type MINMAXINFO
ptReserved As POINTAPI
ptMaxSize As POINTAPI
ptMaxPosition As POINTAPI
ptMinTrackSize As POINTAPI
ptMaxTrackSize As POINTAPI
End TypePublic procOld As LongPublic Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (lpDest As Any, lpSource As Any, ByVal cBytes&)
Public Declare Function CallWindowProc& Lib "user32" Alias "CallWindowProcA" (ByVal lpPrevWndFunc&, ByVal hWnd&, ByVal Msg&, ByVal wParam&, ByVal lParam&)
Public Function WindowProc(ByVal hWnd As Long, ByVal iMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Select Case iMsg
Case WM_GETMINMAXINFO
Dim udtMINMAXINFO As MINMAXINFO
Dim nWidthPixels&, nHeightPixels&
nWidthPixels = Screen.Width \ Screen.TwipsPerPixelX
nHeightPixels = Screen.Height \ Screen.TwipsPerPixelY
CopyMemory udtMINMAXINFO, ByVal lParam, 40&
With udtMINMAXINFO
.ptMaxSize.x = nWidthPixels - (nWidthPixels \ 4)
.ptMaxSize.y = nHeightPixels - (nHeightPixels \ 4)
.ptMaxPosition.x = nWidthPixels \ 8
.ptMaxPosition.y = nHeightPixels \ 8
.ptMaxTrackSize.x = .ptMaxSize.x
.ptMaxTrackSize.y = .ptMaxSize.y
.ptMinTrackSize.x = nWidthPixels \ 4
.ptMinTrackSize.y = nHeightPixels \ 4
End With
CopyMemory ByVal lParam, udtMINMAXINFO, 40&
WindowProc = False
Exit Function
End Select
WindowProc = CallWindowProc(procOld, hWnd, iMsg, wParam, lParam)
End Function
互相交流
E-mail: [email protected]