1、首先在桌面上,鼠标左键双击程序,在打开的VB6主界面上。
2、其次点击左边工具菜单栏,单击标签按钮,在Form1窗口上,绘制出一Label1。
3、最后在其属性窗口上改个名字,点击运行即可。
新建一个文本框Text1,Text属性为空,MultiLine属性为True,ScrollBars属性为2。
新建一个命令按钮Command1,添加以下代码:
Private Sub Command1_Click()
Dim i As Integer
For i = 1 To 100
If (i Mod 5 = 0) And (i Mod 3 <> 0) Then Text1Text = Text1Text & vbCrLf & i
Next
End Sub
Dim LX As Long
Dim LY As Long
Dim MD As Boolean
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
MePSet (X, Y)
LX = X
LY = Y
MD = True
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If MD = True Then
MeLine (LX, LY)-(X, Y)
LX = X
LY = Y
End If
End Sub
Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
MD = False
End Sub
Private Sub Command1_Click()
MeCls
Dim N As Integer, i As Integer
N = InputBox("n=", , 9)
For i = 1 To 2 N - 1
If i <= N Then
Print Space(N - i) + String(2 i - 1, CStr(i))
Else
Print Space(N - (2 N - i)) + String(2 (2 N - i) - 1, CStr(2 N - i))
End If
Next i
End Sub
欢迎分享,转载请注明来源:浪漫分享网
评论列表(0条)