?? createcaret.htm
字號:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 3.0">
<style><!--
body,table {font-family:"宋體"; font-size: 9pt; line-height:11pt;}
a {text-decoration:none} a:hover {color:red;text-decoration:underline}
--></style>
<title>CreateCaret</title>
</head>
<body link="#FF0000" vlink="#FF0000" alink="#FF0000" bgcolor="#FFC8C8">
<div align="center"><center>
<table border="0" width="100%" height="22" cellspacing="0" cellpadding="0">
<tr>
<td width="100%" height="16"><a name="CreateCaret">CreateCaret</a></td>
</tr>
</table>
</center></div><div align="center"><center>
<table border="1" width="100%" bordercolorlight="#808080" cellspacing="0"
bordercolordark="#FFFFFF">
<tr>
<td width="102%" colspan="2">VB聲明</td>
</tr>
<tr>
<td width="102%" colspan="2">Declare Function CreateCaret Lib "user32" Alias
"CreateCaret" (ByVal hwnd As Long, ByVal hBitmap As Long, ByVal nWidth As Long,
ByVal nHeight As Long) As Long</td>
</tr>
<tr>
<td width="102%" colspan="2">說明</td>
</tr>
<tr>
<td width="102%" colspan="2">根據(jù)指定的信息創(chuàng)建一個插入符(光標(biāo)),并將它選定為指定窗口的默認(rèn)插入符。插入符可以是一根短線、一個方塊或者一幅位圖。通常用插入符指示文字在文字框中的插入位置</td>
</tr>
<tr>
<td width="102%" colspan="2">返回值</td>
</tr>
<tr>
<td width="102%" colspan="2">Long,非零表示成功,零表示失敗。會設(shè)置<a
href="GetLastError.htm">GetLastError</a></td>
</tr>
<tr>
<td width="102%" colspan="2">參數(shù)表</td>
</tr>
<tr>
<td width="25%">參數(shù)</td>
<td width="77%">類型及說明</td>
</tr>
<tr>
<td width="25%">hwnd</td>
<td width="77%">Long,擁有插入符的那個窗口的句柄</td>
</tr>
<tr>
<td width="25%">hBitmap</td>
<td width="77%">Long,用作插入符的一幅位圖的句柄。可以是0或1;在這種情況下,插入符可通過nWidth和nHeight參數(shù)創(chuàng)建。如設(shè)為1,則新插入符以灰色顯示;而不是傳統(tǒng)的黑色</td>
</tr>
<tr>
<td width="25%">nWidth</td>
<td width="77%">Long,采用邏輯單位的插入符的寬度</td>
</tr>
<tr>
<td width="25%">nHeight</td>
<td width="77%">Long,采用邏輯單位的插入符的高度</td>
</tr>
<tr>
<td width="102%" colspan="2">注解</td>
</tr>
<tr>
<td width="102%" colspan="2"><p align="left">如創(chuàng)建一個插入符,會同時清除原先的插入符;效果等同于<a
href="DestroyCaret.htm">DestroyCaret</a>函數(shù)。在vb的LostFocus事件期間,不要試圖用<a
href="DestroyCaret.htm">DestroyCaret</a>函數(shù)清除一個插入符。這是由于vb的LostFocus事件不會接收<a
href="DestroyCaret.htm">DestroyCaret</a>直到另一個窗口已經(jīng)有焦點。因此,倘若在那個時候調(diào)用<a
href="DestroyCaret.htm">DestroyCaret</a>,會破壞其他窗口的插入符。如果準(zhǔn)備自己管理插入符,可以(而且應(yīng)該)在WM_KILLFOCUS消息期間清除插入符</td>
</tr>
<tr>
<td width="102%" colspan="2">在vb里使用</td>
</tr>
<tr>
<td width="102%" colspan="2">可以使用。但在應(yīng)用程序切換時,標(biāo)準(zhǔn)的vb文本控件不能處理GotFocus
和 LostFocus事件。因此,很難知道何時為一個控件設(shè)置插入符。此外,vb假設(shè)插入符為一根短豎線,并據(jù)此定義它的位置,所以其他形式的插入符可能無法正確定位</td>
</tr>
</table>
</center></div><div align="center"><center>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="100%"><p align="right"><a href="#CreateCaret">Top</a></td>
</tr>
</table>
</center></div>
</body>
</html>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -