borderAndreaVB free resources for Visual Basic developersborder
borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2014 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (VB6 & bluetooth)Next Topic (Invoice) New Topic New Poll Post Reply
AndreaVB Forum : VB General : How to disable resize form
Poster Message
Nothing but you
Level: Protégé


Registered: 19-09-2005
Posts: 4

icon How to disable resize form

Hi!
I have a difficult question and I need help!
( I have a little of english, try to understand )
How to disable resize form in VB6, user can't resize form and maximinze windows?
Have early answer!
Thankyou!

19-09-2005 at 10:20 AM
View Profile Send Email to User Show All Posts | Quote Reply
humberto
Level: Wizard

Registered: 13-01-2005
Posts: 254
icon Re: How to disable resize form

The MinButton

The MinButton return values are:


True =(Default) The form has a Minimize button.
False =The form doesn't have a Minimize button.

19-09-2005 at 11:02 AM
View Profile Send Email to User Show All Posts | Quote Reply
steve_w
Level: Moderator


Registered: 18-04-2003
Posts: 1137
icon Re: How to disable resize form

Set the forms BorderStyle property to "1 - Fixed Single"

Steve  

19-09-2005 at 11:08 AM
View Profile Send Email to User Show All Posts | Quote Reply
Nothing but you
Level: Protégé


Registered: 19-09-2005
Posts: 4
icon Re: How to disable resize form

Thank you for your help!
But I want form has style border is "2 - resizeable" but user can't resize form.

I try to using this code but I may be Problem!

Private sub Form_resize()
form.height = 1200
form.width  = 1200
end sub

when windows is minimized it have error
so you can help me how to do?
Thank!

20-09-2005 at 12:05 PM
View Profile Send Email to User Show All Posts | Quote Reply
steve_w
Level: Moderator


Registered: 18-04-2003
Posts: 1137
icon Re: How to disable resize form

This will work

Private Sub Form_Resize()

    If Me.WindowState <> vbMinimized Then
    
        Me.Height = 1200
        Me.Width = 1200
    
    End If

End Sub


Steve

20-09-2005 at 12:19 PM
View Profile Send Email to User Show All Posts | Quote Reply
stickleprojects
Level: Moderator


Registered: 09-09-2002
Posts: 1036
icon Re: How to disable resize form

Hi,
I am unsure why you wish to keep the border as resizable, but not allow resizing.. but...
To disable the actual sizing, the only real way is to subclass the form and intercept the resize message, the way listed here will allow the resize and then force the size back again.
Did you want the maximise button disabled too?
Anyway, check out http://www.vbaccelerator.com/codelib/ssubtmr/ctrlres.htm for complete control over form sizing and moving
Hope this helps,
Kieron

____________________________
Build it better, faster, quicker, easier.. then fix it (non-offical MS mission statement)

20-09-2005 at 02:47 PM
View Profile Send Email to User Show All Posts | Quote Reply
fuji_su
Level: Super Expert


Registered: 26-08-2005
Posts: 70
icon Re: How to disable resize form

Just put on error resume next


Private sub Form_resize()
on error resume next

form.height = 1200
form.width  = 1200
end sub





____________________________
-fuji-

21-09-2005 at 01:50 AM
View Profile Send Email to User Show All Posts | Quote Reply
jasonrle0332
Level: Protégé

Registered: 23-08-2010
Posts: 6
icon Re: How to disable resize form

use vb.net component to have a try~~~ recommend: spire.xls for .net  :D

09-12-2010 at 03:19 AM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : VB General : How to disable resize form
Previous Topic (VB6 & bluetooth)Next Topic (Invoice) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
borderAndreaVB free resources for Visual Basic developersborder
borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2014 Andrea Tincaniborder