|
-
Oct 4th, 2000, 09:33 AM
#1
Thread Starter
Hyperactive Member
How can I force a MDI Form to always stay one size. So when people try to resize it in anyway it stays the same.
Thanks in advance for any help provided.
VB 6 Enterprise Edition SP4
ADO, SQL 7/2000, ASP and some JavaScript

>> Life goes on, but for how long? <<
If you can smile when things go wrong, you have someone in mind to blame
-
Oct 4th, 2000, 09:48 AM
#2
Lively Member
Won't just changing the border style property to 'fixed single' do the jobby?
Anakim
It's a small world but I wouldn't like to paint it.
-
Oct 4th, 2000, 09:53 AM
#3
Lively Member
Couldn't you get the various size values during the Load event i.e.
Private Sub MDIForm_Load()
MDIHeight = me.height
MDIWidth = me.width
End Sub
And then in the resize event, reassign these values so when the user resizes the form it goes back the way it was, i.e.
Private Sub MDIForm_Resize()
Me.Width = MDIHeight
Me.Height = MDIWidth
End Sub
-
Oct 4th, 2000, 09:55 AM
#4
Lively Member
wrong way round, sorry
Private Sub MDIForm_Resize()
Me.Width = MDIWidth
Me.Height = MDIHeight
End Sub
-
Oct 4th, 2000, 09:55 AM
#5
Guru
For MDI Forms, this is the best way I can consciously think of right now: 
Code:
Option Explicit
Private Declare Function GetSystemMenu Lib "user32" (ByVal hWnd As Long, ByVal bRevert As Long) As Long
Private Declare Function DeleteMenu Lib "user32" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long) As Long
Private Declare Function DrawMenuBar Lib "user32" (ByVal hWnd As Long) As Long
Private Const SC_SIZE = &HF000
Private Const SC_MAXIMIZE = &HF030
Private Sub MDIForm_Load()
Dim hMenu As Long
hMenu = GetSystemMenu(hWnd, False)
Call DeleteMenu(hMenu, SC_SIZE, 0)
Call DeleteMenu(hMenu, SC_MAXIMIZE, 0)
Call DrawMenuBar(hWnd)
End Sub
-
Oct 4th, 2000, 09:56 AM
#6
Thread Starter
Hyperactive Member
Not with a MDI form, it will with a normal form!
Thanks in advance for any help provided.
VB 6 Enterprise Edition SP4
ADO, SQL 7/2000, ASP and some JavaScript

>> Life goes on, but for how long? <<
If you can smile when things go wrong, you have someone in mind to blame
-
Oct 4th, 2000, 10:05 AM
#7
Lively Member

Spanner (with reference to me, one of the unfeasibly large spanners which only mechanics and plumbers ever seem to own)
Yonatan's answer looks pretty good. I use something similar to Joe's in my MDI app to prevent users from going below a certain size.
Personally I always allow some sizing cuz of the different display resolutions (and it saves some 'does it fit' testing.
Anakim
It's a small world but I wouldn't like to paint it.
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
|