MISSION AND VISION 2012


On this Blog you can gain and collect some ideas, information about different kinds of topics about computer, tutorial and tips that can be applied. You can share your ideas too thru posting comment and feedback to said topic.

Thank You :)

Note : If the Link(s) doesn't work/broken please Comment.

(If this site helps you, please Comment and click the link to say Thanks)
Please Click here to Say Thank You :)



Thursday, February 25, 2010

Fixing the size of your MDI form in Visual Basic 6.0

Example:

Me.WindowState = 0
Me.Width = Your_Default_Width (sample set your MDIform Property: Width:10860)
Me.Height = Your_Default_Height (sample set your MDIform Property: Height :7980)

Like this one:

Me.WindowState = 0
Me.Width = 10860
Me.Height = 7980

1. Change your WindowState in MDIform Property to 2-Maximized
2. Then Resize your MDI form the default that you like.
3. Put this code in your MDIform:

CODE:

Private Sub MDIForm_Resize()
If Me.WindowState = 0 Then
Me.WindowState = 0 'Normal
Me.Width = 10860
Me.Height = 7980
ElseIf Me.WindowState = 2 Then 'Maximized Property
Me.WindowState = 0 'Normal
Me.Width = 10860
Me.Height = 7980
End If
End Sub


This keeps the form in the normal windowstate and doesn't allow the user to change its size. The maximize button box is still visible and trying to change the form's size will briefly work, but the above code quickly intervenes and sets the windowstate and size to the default value.

I don't know how to disabled the maximized button and I'm also want to do it. I'm only a beginner using this Program (vb6). But I love Coding using it. I hope it may help you. Enjoy :) God bless..

pnxstan23

No comments:

Post a Comment