Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Preventing form movement 1

Status
Not open for further replies.

bobgg

Programmer
Jul 1, 2002
7
0
0
GB
Hi, this is my first exposure to vb.net. I have created a form...set the locked property to true,
however the form still moved at runtime. How can I prevent it from moving???
 
try this site


and try this code

Code:
Protected Overrides Sub WndProc(ByRef m As Message) 
 
const Integer WM_NCLBUTTONDOWN = 161 
 
const Integer WM_SYSCOMMAND = 274 
 
const Integer HTCAPTION = 2 
 
const Integer SC_MOVE = 61456 
 

 
If (m.Msg = WM_SYSCOMMAND) &&(m.WParam.ToInt32() = SC_MOVE) Then 
 
Return 
 
End If 
 

 
If (m.Msg = WM_NCLBUTTONDOWN) &&(m.WParam.ToInt32() = HTCAPTION) Then 
 
Return 
 
End If 
 

 
MyBase.WndProc( m) 
 
End Sub

Christiaan Baes
Belgium

What a wonderfull world - Louis armstrong
 
BTW

it was the first site i found after a simple google search

Christiaan Baes
Belgium

What a wonderfull world - Louis armstrong
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top