-
Aug 15th, 2013, 03:36 AM
#1
Thread Starter
Fanatic Member
I have no problem allowing resizing MDIForm ?
I encountered no problems when resizing allows MDIForm, when running this code below:
Code:
Private mHeight As Long, mWidth As Long
Private Sub MDIForm_Load()
mHeight = Me.Height
mWidth = Me.Width
End Sub
'disable mdi form resize
Private Sub MDIForm_Resize()
Me.WindowState = 0 'Normal
Me.Height = mHeight
Me.Width = mWidth
End Sub
when I press MinButton of MIDIForm not. can change the code above to just have two functions: do not allow to resize and allow MinButton (or allow MaxButton) of MDIForm it ?
-
Aug 15th, 2013, 03:44 AM
#2
Re: I have no problem allowing resizing MDIForm ?
If I understand you can resize the form because you are setting to the "Normal" size.
when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
https://get.cryptobrowser.site/30/4111672
-
Aug 15th, 2013, 07:01 AM
#3
Re: I have no problem allowing resizing MDIForm ?
I can't understand the question.
You can't re-size a form if it is set to min or max. You can re-size a form if it is set to normal and the border style allows it to be re-sized.
So what is your question?
-
Aug 15th, 2013, 08:47 AM
#4
Re: I have no problem allowing resizing MDIForm ?
Perhaps the following is what you want?
Code:
Option Explicit
Private Const GWL_STYLE As Long = (-16&) 'Retrieves the window styles.
Private Const WS_SIZEBOX As Long = &H40000 'The window has a sizing border.
Private Declare Function GetWindowLong Lib "user32.dll" Alias "GetWindowLongW" (ByVal hWnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "user32.dll" Alias "SetWindowLongW" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Sub MDIForm_Load()
Move Left, Top, 800! * Screen.TwipsPerPixelX, 600! * Screen.TwipsPerPixelY 'Resize MDIForm to 800x600 px
SetWindowLong hWnd, GWL_STYLE, GetWindowLong(hWnd, GWL_STYLE) And Not WS_SIZEBOX 'Disable resizing from now on
End Sub
On Local Error Resume Next: If Not Empty Is Nothing Then Do While Null: ReDim i(True To False) As Currency: Loop: Else Debug.Assert CCur(CLng(CInt(CBool(False Imp True Xor False Eqv True)))): Stop: On Local Error GoTo 0
Declare Sub CrashVB Lib "msvbvm60" (Optional DontPassMe As Any)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|