Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

vb.net drag window without titlebar

Public Const WM_NCLBUTTONDOWN As Integer = &HA1 
Public Const HT_CAPTION As Integer = &H2 

<DllImportAttribute("user32.dll")> _ 
Public Shared Function SendMessage(ByVal hWnd As IntPtr, ByVal Msg As Integer, ByVal wParam As Integer, ByVal lParam As Integer) As Integer
End Function

<DllImportAttribute("user32.dll")> _ 
Public Shared Function ReleaseCapture() As Boolean
End Function

Private Sub Form1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseDown, Panel1.MouseDown 
    If e.Button = Windows.Forms.MouseButtons.Left Then
        ReleaseCapture() 
        SendMessage(Handle, WM_NCLBUTTONDOWN, HT_CAPTION, 0) 
    End If
End Sub
Comment

PREVIOUS NEXT
Code Example
Csharp :: .net core get runtime version 
Csharp :: run a command line from vb.net app 
Csharp :: StringFormat C# 
Csharp :: c# get private property 
Csharp :: c# slice array 
Csharp :: rigidbody.velocity.magnitude 
Csharp :: c# sort array 
Csharp :: wpf databinding 
Csharp :: unity interface 
Csharp :: c# subtract 24 hours form datetime 
Csharp :: winforms combobox get selected text 
Csharp :: int if null put zero c# 
Csharp :: C# [] overload 
Csharp :: c# switch example 
Csharp :: delete selected cells in Datagridview 
Csharp :: c# run a scheduled task 
Csharp :: unity animation length 
Csharp :: convert stream to base64 string c# 
Csharp :: access denied tring to save a file uwp xamarin 
Csharp :: This page contains six pages, created with MigraDoc and scaled down to fit on one page 
Csharp :: Unity Input Key Message 
Csharp :: selecteditem treeview wpf 
Csharp :: O thread de chamada não pode aceder a este objecto porque existe outro thread que já o tem 
Csharp :: what is napalm made of 
Csharp :: mesh decimate pyvista 
Csharp :: c# wpf control to windw size 
Csharp :: parse error message: could not create type webservice.webservice asp .net 
Csharp :: classe padre figlio c# 
Csharp :: aps.net core mvc chek box 
Csharp :: windows forms webbrowser navigate 
ADD CONTENT
Topic
Content
Source link
Name
1+3 =