注意:要设置form的controlbox属性为false,
特别注意: form.text要设置为空,否则不会把标题栏去掉
dim mousx as integer
dim mousy as integer
dim currx as integer
dim curry as integer
public sub mymousedown(byval sender as object, byval ex as mouseeventargs) handles mybase.mousedown
if ex.button = mousebuttons.left then
'如果是鼠标左键,则不捕获鼠标
me.capture() = false
'获得鼠标坐标(相对于窗体)
mousx = ex.x
mousy = ex.y
end if
end sub
public sub mymousemove(byval sender as object, byval ex as mouseeventargs) handles mybase.mousemove
if ex.button = mousebuttons.left then
'左键操作
currx = me.left - mousx + ex.x
curry = me.top - mousy + ex.y
'设置窗体相对于屏幕的坐标
me.setdesktoplocation(currx, curry)
end if
end sub
'
public sub mymouseup(byval sender as object, byval ex as mouseeventargs) handles mybase.mouseup
if ex.button = mousebuttons.left then
me.capture() = true
end if
end sub
Java Asp PHP .Net XML C/C++ CGI VB Jsp J2ee J2se J2me EJB Servlet Tomcat Resin Struts Weblogic Eclipse ANT GUI JMS Web servise IDEA Webphere Hibernate Spring Jboss Applet Swing Socket Javamail Perl Ajax P2P 安全 模式 框架 测试 开源 游戏
Windows XP Windows 2000 Windows 2003 Windows Me Windows 9.x Linux UNIX 注册表 操作系统 服务器 应用服务器