⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 vbp.htm

📁 对于学习很有帮助
💻 HTM
字号:
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>为VB应用程序定制浮动提示</title>
</head>

<body bgcolor="#FFFFFF" text="#000000">

<table>
  <tr>
    <td vAlign="top" width="672"><p align="center"><font color="#004080" face="黑体"><strong>为VB应用程序定制浮动提示<br>
    </strong></font></td>
  </tr>
  <tr>
    <td vAlign="top" width="672"><p class="ourfont"><font color="#000000">&nbsp;&nbsp;&nbsp; 
    在Win95中,当我们将鼠标移至某个控件上时,便会在鼠标所指之处弹出一个小窗口,告诉我们这个控件的用途,这便是“浮动提示”。这种提示方式可以及时地提供有关信息,那么怎样在VB中实现这种功能呢?<br>
    &nbsp;&nbsp;&nbsp; 首先我们在Form的任意位置放一个Text1作为浮动提示的通用文本显示框,几个重要属性设置为:<br>
    &nbsp;&nbsp;&nbsp; Appearance:0-Flat<br>
    &nbsp;&nbsp;&nbsp; BackColor:窗口背景颜色<br>
    &nbsp;&nbsp;&nbsp; BorderStyle:1-FixedSingle<br>
    &nbsp;&nbsp;&nbsp; ForeColor:窗口文本颜色<br>
    &nbsp;&nbsp;&nbsp; Height:文本框高度,一般取286左右<br>
    &nbsp;&nbsp;&nbsp; Visible:False<br>
    &nbsp;&nbsp;&nbsp; 如果该Text1不是在所有按钮设置以后才放置的,则在显示在它之后放置的按钮的浮动提示时,浮动提示将被该按钮所掩盖,这时需要按Ctrl+J或者在“Edit”菜单中选择“BringtoFront”将Text1带回前台。<br>
    &nbsp;&nbsp;&nbsp; 然后,在Module1通用模块中定义一个用于存放任意浮动提示文本的公共FloatMessage字符串变量: 
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
    PublicFloatMessageAsString<br>
    &nbsp;&nbsp;&nbsp; 再在Form的General中加入一个如下公用函数,其功能是用一个文本框自动匹配和管理所有浮动提示: 
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PublicFunctionShowMessage()IfText1

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -