?? vb11.htm
字號:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0057)http://www.pconline.com.cn/experience/subject/VB/vb11.htm -->
<HTML><HEAD><TITLE>|><| 太平洋電腦信息網(wǎng)</TITLE><!-- #BeginTemplate "/Templates/0723.dwt" --><!-- #BeginEditable "doctitle" --><!-- #EndEditable -->
<META content="text/html; charset=gb2312" http-equiv=Content-Type><LINK
href="vb11.files/text.css" rel=stylesheet>
<STYLE type=text/css>.sfont {
LINE-HEIGHT: 18pt
}
</STYLE>
<META content="MSHTML 5.00.2014.210" name=GENERATOR></HEAD>
<BODY bgColor=#ffffff leftMargin=0 topMargin=0>
<TABLE align=center border=0 cellPadding=0 cellSpacing=0 width="100%">
<TBODY>
<TR>
<TD vAlign=top width="100%">
<TABLE border=0 cellPadding=0 cellSpacing=0 width="100%">
<TBODY>
<TR bgColor=#303880>
<TD><A href="http://www.pconline.com.cn/"><IMG alt=太平洋電腦信息網(wǎng) border=0
height=18 hspace=30 src="vb11.files/txtpconline.gif"
width=96></A><IMG height=10 src="vb11.files/blank.gif"
width=400></TD></TR></TBODY></TABLE></TD>
<TD align=right background=vb11.files/bw.gif noWrap width=130><IMG
height=26 src="vb11.files/bw.gif" width=10><A
href="http://www.pconline.com.cn/sitemap/"><IMG alt=網(wǎng)站地圖 border=0
height=26 src="vb11.files/sitemap.gif" width=21></A><IMG height=26
src="vb11.files/bw.gif" width=10><A
href="http://www.pconline.com.cn/tpy/"><IMG alt=關于太平洋 border=0 height=26
src="vb11.files/aboutus.gif" width=21></A><IMG height=26
src="vb11.files/bw.gif" width=10><A
href="http://www.pconline.com.cn/tpy/tariff.html"><IMG alt=與我們聯(lián)系 border=0
height=26 src="vb11.files/contact.gif" width=21></A><IMG height=26
src="vb11.files/bw.gif" width=10></TD></TR></TBODY></TABLE><BR>
<TABLE align=center border=0 cellPadding=0 cellSpacing=0 width=760>
<TBODY>
<TR>
<TD bgColor=#666666><IMG height=1 src="vb11.files/blank.gif" width=1></TD>
<TD bgColor=#666666><IMG height=1 src="vb11.files/blank.gif" width=1></TD>
<TD> </TD>
<TD colSpan=2 noWrap><A
href="http://www.pconline.com.cn/experience/index.html"><IMG
align=absBottom alt=企業(yè)之窗 border=0 height=15
src="vb11.files/txtexperience.gif" width=68></A> <A
href="http://www.pconline.com.cn/">首 頁</A> <A
href="http://www.pconline.com.cn/market/">今日報價</A> <A
href="http://www.pconline.com.cn/recommend/">產(chǎn)品推介</A> <A
href="http://www.pconline.com.cn/yp/">企業(yè)之窗</A> <A
href="http://www.pconline.com.cn/news/">科技新聞</A> <A
href="http://www.pconline.com.cn/product/">產(chǎn)品查詢</A> <A
href="http://www.pconline.com.cn/download/">軟件下載</A></TD></TR>
<TR>
<TD><IMG height=1 src="vb11.files/blank.gif" width=1></TD>
<TD><IMG height=1 src="vb11.files/blank.gif" width=1></TD>
<TD><IMG height=1 src="vb11.files/blank.gif" width=21></TD>
<TD bgColor=#ffa000 colSpan=2><IMG height=1 src="vb11.files/blank.gif"
width=1></TD></TR>
<TR>
<TD bgColor=#666666><IMG height=1 src="vb11.files/blank.gif" width=1></TD>
<TD bgColor=#cdcdcd><IMG height=5 src="vb11.files/blank.gif" width=1></TD>
<TD align=right colSpan=3><IMG height=6 src="vb11.files/ffa000.gif"
width=1></TD></TR>
<TR>
<TD bgColor=#666666><IMG height=1 src="vb11.files/blank.gif" width=1></TD>
<TD align=right><A href="http://www.pconline.com.cn/"><IMG alt=太平洋電腦信息網(wǎng)
border=0 height=35 src="vb11.files/pconline.com.cn.gif" vspace=10
width=162></A></TD>
<TD> </TD>
<TD vAlign=bottom><!-- #BeginEditable "important_news" --><IMG height=40
src="vb11.files/blank.gif" width=350><!-- #EndEditable --></TD>
<TD align=right vAlign=top><!-- #BeginEditable "adv_top" --><IMG alt=廣告位
height=43 src="vb11.files/icon.gif"
width=190><!-- #EndEditable --></TD></TR></TBODY></TABLE>
<TABLE align=center border=0 cellPadding=0 cellSpacing=0 width=760>
<TBODY>
<TR>
<TD bgColor=#666666 width=1><IMG height=1 src="vb11.files/blank.gif"
width=1></TD>
<TD vAlign=top width=170><!-- #BeginEditable "addons" --><!--替代為附加信息 --><!-- #EndEditable --></TD>
<TD bgColor=#666666 width=1><IMG height=1 src="vb11.files/blank.gif"
width=1></TD>
<TD><IMG height=1 src="vb11.files/blank.gif" width=21></TD>
<TD colSpan=3 vAlign=top width=566><!-- #BeginEditable "1" --><IMG
height=1 src="vb11.files/blank.gif" width=566><BR><IMG height=1
src="vb11.files/666666.gif" width=420><BR><IMG height=13
src="vb11.files/blank.gif" width=1><A
href="http://www.pconline.com.cn/experience/">經(jīng)驗共享</A> > <SPAN
class=greenb><A
href="http://www.pconline.com.cn/experience/subject/VB/index.html">專題教程</A></SPAN><A
href="http://www.pconline.com.cn/experience/subject/VB/index.html">
VB專區(qū)</A>> <BR><IMG height=1 src="vb11.files/666666.gif" vspace=1
width=420><BR>
<P align=center><B><FONT color=#000066>VB編程中如何鎖定鼠標</FONT></B></P>
<P align=center>出自:電腦報</P>
<P
class=sfont> 鎖定鼠標!什么意思?有人一定不明白了,好!讓筆者先說明一下吧!鎖定鼠標就是讓你的鼠標不能移動,不能單擊,當然也不能雙擊,不能做任何事,反正就是讓鼠標本來應有的功能都失效,就跟壞了的一樣,很有趣的。你也可以嘗試編寫一個和你的朋友開個小小的玩笑,不過,不要忘記還原啊!OK!就讓筆者用VB編程為各位演示一下這個程序吧!<BR> 首先,新建工程,在FORM1上放上兩個COMMAND命令按鈕(即COMMAND1與COMMAND2),其屬性都保持不變,然后請輸入以下程序代碼:<BR> Private
Declare Function ClipCursor Lib ″user32″ (lpRect As Any) As
Long<BR> Private Type RECT<BR> Left As Long<BR> Top As Long<BR> Right
As Long<BR> Bottom As Long<BR> End Type //以上代碼請從API函數(shù)瀏覽器中復制即可。<BR> Dim
DENG As RECT<BR> Dim SS As Boolean
//是鎖定或是釋放的判斷<BR> ------------<BR> Private Sub Form_Load()
//作初始化設置。<BR> SS = True<BR> Command1.Caption =
″單擊將鎖定鼠標,鎖定后按回車將被釋放″。<BR> Command2.Caption = ″結束程序″<BR> Form1.Caption =
″鎖定鼠標的演示程序″<BR> End Sub<BR> -----------<BR> Private Sub
Command1_Click() //鎖定鼠標<BR> If SS = True Then
//如果鼠標沒有被鎖定則鎖定它。<BR> DENG.Left = 0:DENG.Top = 0
//必要設置,四個都為零。<BR> DENG.Right = 0:DENG.Bottom = 0<BR> ClipCursor DENG :
SS = False //鎖定鼠標且重新賦值給SS。<BR> Else <BR> ClipCursor ByVal 0& : SS = True
//釋放鼠標且重新賦值給SS<BR> End If<BR> End Sub<BR> -----------<BR> Private Sub
Command2_Click()<BR> End //結束程序。<BR> End
Sub<BR> 現(xiàn)在運行一下吧(按下F5),單擊COMMAND1鼠標將被鎖定,鎖定后要釋放請按下回車鍵即可。當然你也可以把上面的DENG的LEFT,TOP,RIGHT,BOTTOM值都改成100(或每個都不相同的值)再試一試,相信你一定會有其他新的收獲!<BR> 注:以上程序在中文WINDOWS98,
中文VB5.0專業(yè)版中調(diào)試通過!<BR><B>(上海 季昭君)</B> </P>
<P align=right class=sfont><A
href="http://www.pconline.com.cn/index.html">更多文章……</A></P><!-- #EndEditable --></TD></TR></TBODY></TABLE>
<TABLE align=center border=0 cellPadding=0 cellSpacing=0 width=760>
<TBODY>
<TR>
<TD bgColor=#666666 width=1><IMG height=1 src="vb11.files/blank.gif"
width=1></TD>
<TD align=right vAlign=bottom width=170><IMG height=10
src="vb11.files/blank.gif" width=170><BR></TD>
<TD bgColor=#666666 width=1><IMG height=1 src="vb11.files/blank.gif"
width=1></TD>
<TD width=21><IMG height=1 src="vb11.files/blank.gif" width=21></TD>
<TD bgColor=#eeeeee width=566><IMG height=10 src="vb11.files/blank.gif"
width=566><BR>版權所有©1999 太平洋電腦信息網(wǎng)<BR><FONT
face="Arial, Helvetica, sans-serif"><A
href="mailto:exp@pconline.com.cn">exp@pconline.com.cn</A></FONT> <IMG
height=1 src="vb11.files/hhvisit.html" width=1> </TD></TR></TBODY></TABLE><!-- #EndTemplate --></BODY></HTML>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -