|
-
Move Form without title bar
Hi folks
Well, i have created a gradient elipsed winform without title bar. I couldn´t
move the form, but i have used API and translated it (like in vb6) to move
it:
**************************
Public Declare Function SendMessage Lib "User32" Alias "SendMessageA"
(ByVal hWnd As IntPtr, ByVal wMsg As Integer, ByVal wParam As Integer, ByVal
lParam As Integer) As Integer
Public Declare Sub ReleaseCapture Lib "User32" () 'API que liberta o
rato
Public Const WM_NCLBUTTONDOWN = &HA1 'constatne que detecta o botăo primido
Public Const HTCAPTION = 2 'constante que faz mover o formulário
*************************
On MouseDownd of the form:
************************************
Private Sub Form1_MouseDown(blah blah)
Dim valor_retorno As Integer
'libertar rato
Call ReleaseCapture()
'mover o formulário com HTCAPTION
valor_retorno = SendMessage(Handle, WM_NCLBUTTONDOWN, HTCAPTION, 0&)
End Sub
*****************
Well, the form moves, but there´s any way to move it without using API? It
is kind of lame not?
By the way, i think .NET ignores a little the win32 API functions, like the
processing of sending and capture windows messages (sub and hiper classing)...
Jonas
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks