qqexp025.html
来自「包含大量VB常用函数 大概一百几十个左右 每个函数都有比较详细的说明 希望大家喜」· HTML 代码 · 共 81 行
HTML
81 行
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html">
<meta name="Generator" content="千千VB站 VB函数清单">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>千千VB站 VB函数清单</title>
</head>
<body text="#000000" bgcolor="#FFFFFF" link="#2020A0" vlink="#FF0000" alink="#FF0000" background="picbkgd.gif" tppabs="space.gif">
<marquee><b><blink><font color="#000000">条件判断</font></blink></b></marquee>
<center>
<hr width="100%" szie="4">
</center><font color="#000000"></font>
<p><font color="#000000">设计VB程序除了学会使用函数、功能与变数组合运用变换外,也要学习使用判断与法,If
... Then ... Else 这个语法便提供你判断数值或运算值。</font>
<p><font color="#000000">If的用法:</font>
<p><font color="#000000">(01)If 运算式 Then 程序码</font>
<p><font color="#000000"> If A = 1 Then
MsgBox "A等於1"</font><br>
<font color="#000000"> If A ^ 2 + B ^ 2 = C
^ 2 Then Label1.Caption = "这是一个三角形"</font><br>
<font color="#000000"> If True Then MsgBox
"True"</font><br>
<font color="#000000"></font> <font color="#000000"></font>
<p><font color="#000000">(02)If 运算式 Then 程序码 Else 程序码</font>
<p><font color="#000000"> If A = 1 Then
MsgBox "A等於1" Else MsgBox "A不等於1"</font><br>
<font color="#000000"> If A ^ 2 + B ^ 2 = C
^ 2 Then Label1.Caption = "这是一个三角形" Else Label1.Caption
= "这不是三角形"</font><br>
<font color="#000000"> If True Then MsgBox
"True" Else MsgBox "False"</font><br>
<font color="#000000"></font> <font color="#000000"></font>
<p><font color="#000000">(03)If 运算式 Then</font><br>
<font color="#000000">
程序码</font><br>
<font color="#000000"> Else</font><br>
<font color="#000000">
程序码</font><br>
<font color="#000000"> End If</font><font color="#000000"></font>
<p><font color="#000000"> If A = 1 Then</font><br>
<font color="#000000">
MsgBox "A等於1"</font><br>
<font color="#000000"> Else</font><br>
<font color="#000000">
MsgBox "A不等於1"</font><br>
<font color="#000000"> End IF</font><font color="#000000"></font>
<p><font color="#000000"> If A ^ 2 + B ^ 2 =
C ^ 2 Then</font><br>
<font color="#000000">
Label1.Caption = "这是一个三角形"</font><br>
<font color="#000000"> Else</font><br>
<font color="#000000">
Label1.Caption = "这不是三角形"</font><br>
<font color="#000000"> End If</font><br>
<font color="#000000"></font> <font color="#000000"></font>
<p><font color="#000000">(04)多重的If,可以视情况自由搭配。</font><br>
<font color="#000000"> If 运算式 Then</font><br>
<font color="#000000"> If
运算式 Then 程序码</font><br>
<font color="#000000"> Else</font><br>
<font color="#000000"> If
运算式 Then</font><br>
<font color="#000000">
程序码</font><br>
<font color="#000000">
Else</font><br>
<font color="#000000">
程序码</font><br>
<font color="#000000"> End
If</font><br>
<font color="#000000"> End If</font>
</body>
</html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?