Formu Sabitleme
Formumuzun taşınmasını istemiyorsak, aşağıdaki hazır kod bayağı işimize yarayacak. İlk önce ;
Imports System.Runtime.InteropServices
formunuza ekleyin.
Form1.vb
Imports
System.Runtime.InteropServicesPublic
Class Form1 Private Const WM_MOVING As Integer = &H216<StructLayout(LayoutKind.Sequential)> _
Public Structure RECT Public Left As Integer Public Top As Integer Public Right As Integer Public Bottom As Integer End Structure<DllImport(
"user32.dll")> _ Public Shared Function GetWindowRect(ByVal hWnd As IntPtr, ByRef lpRect As RECT) As Boolean End Function Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message) If m.Msg = WM_MOVING Then Dim r As New RECTGetWindowRect(
Me.Handle, r)Marshal.StructureToPtr(r, m.LParam,
True) End If MyBase.WndProc(m) End SubEnd
ClassBir makalenin daha sonuna geldik. Bir sonraki makalede görüşmek dileğiyle. Hoşçakalın. Bahadır ŞAHİN