Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27226

VS 2010 Prevent maximizing

$
0
0
I currently have a form and it's properties are:

Code:

        With Me
            .AutoSize = True
            .BackColor = Color.CornflowerBlue
            .FormBorderStyle = FormBorderStyle.FixedToolWindow
            .KeyPreview = True
            .MaximumSize = New Size(250, 250)
            .Size = New Size(250, 250)
            .Text = "Menu"
            .StartPosition = FormStartPosition.CenterScreen
        End With

The maximum size is to prevent the user from maximizing the form by double-clicking on the title bar. However, if the user does double-click on the title bar, the form still snaps to the upper-left hand corner of the screen. This looks odd because the user would expect for the form to maximize, but if the see it snap to the upper-left hand corner and not maximize, they may think that something is wrong. So, long story short... can I prevent it from snapping to the upper-left hand corner of the screen when the user double-clicks on the title bar?

Viewing all articles
Browse latest Browse all 27226

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>