"Rob" <rl*****@worldnet.att.netschrieb
I want to resize the height of a form without resizing the width,
therefore I tried:
Private Sub Form1_Resize(ByVal sender As Object, ByVal e As
System.EventArgs) Handles MyBase.Resize
Me.Width = 226
End Sub
However this causes a lot of flickering on my form. How can I turn
off the flickering ?
Example:
Imports System.Runtime.InteropServices
Public Class Form1
<StructLayout(LayoutKind.Sequential)_
Private Structure MinMaxInfo
Public reserved As Point
Public maxSize As Point
Public maxPosition As Point
Public minTrackSize As Point
Public maxTrackSize As Point
End Structure
Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)
Const WM_GETMINMAXINFO As Integer = &H24
MyBase.WndProc(m)
If m.Msg = WM_GETMINMAXINFO Then
Dim mmi As MinMaxInfo
mmi = DirectCast( _
Marshal.PtrToStructure(m.LParam, GetType(MinMaxInfo)), _
MinMaxInfo _
)
mmi.maxTrackSize.X = 226
mmi.minTrackSize.X = 226
Marshal.StructureToPtr(mmi, m.LParam, True)
End If
End Sub
End Class
Armin