在VB里输出九九乘法表

请问要怎么样编写

vb中输出九九乘法表,可以参考下面的代码:

Private Sub Form_Click()

For a = 1 To 9

For b = 1 To a

Print b; "*"; a; "="; b * a;

Next b

Print

Next a

End Sub

扩展资料:

VB基本函数列举:

CBool 函数: 返回已被转换为 Boolean 子类型的变体的表达式。 

CByte 函数: 返回已被转换为字节子类型的变体的表达式。

CCur 函数 :返回已被转换为货币子类型的变体的表达式。 

CDate 函数: 返回已被转换为日期子类型的变体的表达式。 

CDbl 函数: 返回已被转换为双精度子类型的变体的表达式。 

Chr 函数: 返回指定 ANSI 字符码的字符。 

参考资料来源:百度百科-Visual Basic

温馨提示:内容为网友见解,仅供参考
第1个回答  2008-11-10
Private Sub Command1_Click()
Dim i, j, s
For i = 1 To 9
For j = 1 To i
s = s & j & "×" & i & "=" & IIf(Len(i * j) < 2, i * j & " ", i * j) & " "
Next
s = s & vbCrLf
Next
Print s
End Sub
第2个回答  推荐于2017-10-07
Private Sub Form_click()
For a = 1 To 9
For b = 1 To a
Print b; "*"; a; "="; b * a;
Next b
Print
Next a
End Sub本回答被提问者采纳
第3个回答  2018-06-18

第4个回答  推荐于2017-09-24
Private Sub Form_click()
For a = 1 To 9
For b = 1 To a
Print b; "*"; a; "="; b * a;
Next b
Print
Next a
End Sub
Private Sub Form_Load()
Me.AutoRedraw = True
Cls
For j = 1 To 9
For k = 1 To 9
If k > j Then Exit For
Print k & "*" & j & "=" & j * k; " ";
Next k
Print
Next j
End Sub
Private Sub Form_Click()
Dim i, j As Integer
For i = 1 To 9
For j = i To 9
Line (i * 200, j * 250)-(i * 200, j * 250)
ForeColor = i * j * 253
Print Space((i - 1) * 6); i & "×" & j & "=" & i * j
Next j
Next i
End Sub

vb中怎么输出九九乘法表?
vb中输出九九乘法表,可以参考下面的代码:Private Sub Form_Click()For a = 1 To 9 For b = 1 To a Print b; "*"; a; "="; b * a;Next b Print Next a End Sub

用vb在文本框里输出九九乘法表
vb中输出九九乘法表,可以参考下面的代码:Private Sub Form_Click()For a = 1 To 9 For b = 1 To a Print b; "*"; a; "="; b * a;Next b Print Next a End Sub

用VB编一个九九乘法表,程序应该怎么写,求救!
本示例使用Visual Basic编写了一个九九乘法表程序。以下为程序代码:在编写程序前,我们需要定义两个整型变量i和j,分别用于表示行数和列数,以及一个字符串变量str用于存储乘法表。通过设置Me.AutoRedraw = True,可以实现在输出过程中实时更新控件。使用For循环,遍历i从1到9。在循环内部,定义一个空字...

怎么用VB打九九乘法表
三角形的九九乘法表 Private Sub Form_Load()Dim i, j, s For i = 1 To 9 For j = 1 To i s = s & j & "×" & i & "=" & IIf(Len(i * j) < 2, i * j & " ", i * j) & " "Next s = s & vbCrLf Next MsgBox s End Sub ...

怎样用vb在窗体上输出九九乘法表?
Private Sub Form_Click()Dim i, j As Integer Dim s As String Print Tab(35); "九九乘法表"For i = 1 To 9 For j = 1 To i s = i & "×" & j & "=" & i * j Print Tab((j - 1) * 9 + 2); s;Next j Print Next i End Sub ...

VB程序设计,功能是打印“九九表”,如图所示。
Private Sub Command3_Click()Print Tab(35); "九九乘法表(上三角)" For i = 1 To 9 For j = i To 9 '就只有这里有点变化i to 9 Print Tab((j - 1) * 9); i & "×" & j & "=" & i * j; Next j Print Next iEnd Sub ...

用VB程序怎么做九九乘法表?
Public Class Form1 Private Sub Button1_Click(sender As Object,e As EventArgs)Handles Button1.Click Dim i,j As Integer Dim se As String Label1.Text=""For i=1 To 9 Step 1 For j=1 To 9 Step 1 se=i&"x"&j&"="&i*j Label1.Text&=se&Space(10-Len(se))Next Label1....

用vb编写九九乘法表
用VB程序怎么做九九乘法表的步骤如下:创建显示结果的窗体:编写按钮宏 Private Sub Command1_Click()Dim a, b As Integer Dim s As String: s = ""For a = 1 To 9 For b = 2 To 9 s = s & a & "*" & b & "=" & b * a If b <> 9 Then s = s & Space(1) Else...

求代码,用vb制作九九乘法表
Private Sub Command1_Click()Dim i, j As Integer For i = 1 To 9 For j = 1 To i Print i; "*"; j; "="; i * j;Next j Print Next i End Sub 窗体设置:一个lable一个command就行了

vb编程输出九九乘法表
VB中,一行一句命令,如果你想多句命令一行,可用冒号隔开。print省略参数就表示输出一个空行。简单说,"print:print"就等于:print print 打印两行空行。(3)tab(n)函数。用来将光标移到参数n指定的位置开始输出信息。tab(i*6),(i=1,2,3...),也就是在第6、12、24...格才输出表达式,这样...

相似回答