注册 登录
编程论坛 VB6论坛

刚接触VB6.0求代码示例

Aviva_Wang 发布于 2013-04-09 18:59, 634 次点击
刚接触VB6.0求代码示例
8 回复
#2
Artless2013-04-09 19:43
那方面?
private sub command1_click()
msgbox "hello!"
end sub

[ 本帖最后由 Artless 于 2013-4-9 19:45 编辑 ]
#3
Aviva_Wang2013-04-09 19:55
要一个项目
#4
Aviva_Wang2013-04-09 19:56
本人贪心想要一个带有增删改查的项目

#5
VB题2013-04-09 21:01
刚接触VB6.0求代码示例
label1.label="欢迎使用VB6.0"
x=val(text1.text)
if x mod 2 =0 then
print "此数为偶数"
else
print "此数奇数"
endif
#6
seafish0112013-04-09 21:47
private sub Tnow()
    msgbox "现在的时间是:" & format(now,"hh:mm:ss")
end sub
#7
yz10252013-04-09 23:02
无聊等雨停~随便写的~
程序代码:

Option Explicit

Dim A() As String, iCount As Integer, Ch As Boolean

Private Sub Command1_Click()
    Ch = False
    If Trim$(Text1.Text) <> "" Then
        If Trim$(A(0)) = "" Then
            A(0) = Trim$(Text1.Text)
        Else
            ReDim Preserve A(UBound(A) + 1)
            A(UBound(A)) = Trim$(Text1.Text)
        End If
        List1.AddItem Trim$(Text1.Text)
        Text1.Text = ""
    End If
End Sub

Private Sub Command2_Click()
Dim i As Integer
    If ((iCount > 0) And (List1.ListCount > 0)) Then
        List1.RemoveItem iCount
        ReDim A(List1.ListCount - 1)
        For i = 0 To List1.ListCount - 1
            A(i) = List1.List(i)
        Next i
        iCount = 0
    End If
End Sub

Private Sub Command3_Click()
Dim i As Integer
    If ((iCount > 0) And (List1.ListCount > 0)) Then
        Text1.Text = List1.List(iCount)
        If Ch = True Then
            A(iCount) = Trim$(Text1.Text)
            List1.Clear
            For i = 0 To UBound(A)
                List1.AddItem A(i), CInt(i)
            Next i
        End If
        Ch = False
    End If
End Sub

Private Sub Command4_Click()
    List1.Refresh
End Sub

Private Sub Form_Load()
    Text1.Text = ""
    Command1.Caption = "ADD"
    Command2.Caption = "Delete"
    Command3.Caption = "Chang"
    Command4.Caption = "Check"
    List1.Clear
    Ch = False: iCount = 0
    ReDim A(iCount)
End Sub

Private Sub List1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If Button = 1 Then iCount = List1.ListIndex
End Sub

Private Sub Text1_GotFocus()
    Ch = True
End Sub
#8
Aviva_Wang2013-04-10 07:29
谢谢你们,可是,我还想要更多的项目类型的代码
#9
yz10252013-04-10 09:11
相信这边都有~全学会就当版主了~
https://bbs.bccn.net/forumdisplay.php?fid=6&filter=digest
1