TH3A Zoo Doiiiiiiiiii

Bạn có muốn phản ứng với tin nhắn này? Vui lòng đăng ký diễn đàn trong một vài cú nhấp chuột hoặc đăng nhập để tiếp tục.
TH3A Zoo Doiiiiiiiiii

TH3A Zoo Doiiiiiiiiii


3 posters

    Bài tập lập trình VisualBasic

    avatar
    anhtuan
    Trung Uý
    Trung Uý


    Tổng số bài gửi : 40
    Registration date : 07/07/2008

    Bài tập lập trình VisualBasic Empty Bài tập lập trình VisualBasic

    Bài gửi by anhtuan Thu Jul 24, 2008 3:27 pm

    Bài 1: Nạp danh sách
    Bài tập lập trình VisualBasic Nap_ds10
    Private Sub cmdchon_Click()
    Dim i
    Do While i <= list1.ListCount - 1
    If list1.Selected(i) = True Then
    list2.AddItem list1.List(i)
    list1.RemoveItem i
    Else
    i = i + 1
    End If
    Loop
    End Sub

    Private Sub cmdchontat_Click()
    Dim i
    For i = 0 To list1.ListCount - 1
    list2.AddItem list1.List(i)
    Next i
    list1.Clear
    End Sub

    Private Sub cmdchuyen_Click()
    Dim i
    For i = 1 To list2.ListCount - 1
    list1.AddItem list2.List(i)
    Next i
    list2.Clear
    End Sub

    Private Sub cmdnap_Click()
    Dim filename, filenumber, antem
    filename = "c:\tuan.txt"
    filenumber = FreeFile
    anitem = ""
    Open filename For Input As filenumber
    Do While Not EOF(filenumber)
    Line Input #filenumber, antem
    list1.AddItem antem
    Loop
    End Sub

    Private Sub cmdxoa_Click()
    Dim i
    Do While i <= list1.ListCount - 1
    If list1.Selected(i) = True Then
    list1.RemoveItem i
    Else
    i = i + 1
    End If
    Loop
    End Sub

    Bài 2: Thực hiện phép tính


    Bài tập lập trình VisualBasic Thuc_h10

    Private Sub cmddong_Click()
    End
    End Sub

    Private Sub cmdthulai_Click()
    txt1.Text = ""
    txt2.Text = ""
    txt1.SetFocus
    End Sub

    Private Sub cmdtinh_Click()
    If optcong.Value Then
    MsgBox "Cong hai so"
    txtketqua.Text = CInt(txt1.Text) + CInt(txt2.Text)
    ElseIf opttru.Value Then
    MsgBox "Tru hai so"
    txtketqua.Text = CInt(txt1.Text) - CInt(txt2.Text)
    ElseIf optnhan.Value Then
    MsgBox "Nhan hai so"
    txtketqua.Text = CInt(txt1.Text) * CInt(txt2.Text)
    ElseIf optcongchuoi.Value Then
    txtketqua.Text = txt1.Text & txt2.Text
    End If
    End Sub

    Bài 3: Giải phương trình bậc 2

    Bài tập lập trình VisualBasic Pt_b210

    Private Sub cmdgiai_Click()
    Dim a, b, c, delta
    a = CInt(txta.Text)
    b = CInt(txtb.Text)
    c = CInt(txtc.Text)
    delta = b ^ 2 - 4 * a * c
    If (delta = 0) Then
    MsgBox "Phuong trinh co nghiem kep"
    ElseIf (delta < 0) Then
    MsgBox "Phuong trinh vo nghiem"
    Else
    MsgBox "Phuong trinh co 2 nghiem phan biet"
    txtx1.Text = (-b + Sqr(delta)) / (2 * a)
    txtx2.Text = (-b - Sqr(delta)) / (2 * a)
    End If
    End Sub

    Bài 4: Giải hệ phương trình

    Bài tập lập trình VisualBasic Hephuo10

    Private Sub cmdgiai_Click()
    Dim a1, a2, b1, b2, c1, c2, d, dx, dy
    a1 = CInt(txta1.Text)
    a2 = CInt(txta2.Text)
    b1 = CInt(txtb1.Text)
    b2 = CInt(txtb2.Text)
    c1 = CInt(txtc1.Text)
    c2 = CInt(txtc2.Text)
    d = a1 * b2 - a2 * b1
    dx = c1 * b2 - c2 * b1
    dy = a1 * c2 - a2 * c1
    If (dx <> 0) Then
    MsgBox "Phuong trinh co nghiem"
    txtx.Text = dx / d
    txty.Text = dy / d
    ElseIf (dx = 0 And dy = 0 And d = 0) Then
    MsgBox "Phuong trinh vo dinh"
    ElseIf (dx = 0 And dy = 0) Then
    MsgBox "Phuong trinh vo nghiem"
    End If
    End Sub

    BÀi 5: Danh sách


    Bài tập lập trình VisualBasic Danhsa10

    Private Sub cmdluu_Click()
    Dim i, filename, filenumber
    filename = "c:\phuong.txt"
    filenumber = FreeFile
    Open filename For Output As filenumber
    For i = 0 To List1.ListCount - 1
    Print #filenumber, List1.List(i)
    Next i
    Close filenumber
    End Sub




    Private Sub cmdthem_Click()
    List1.AddItem txthoten.Text & ";" & txtnamsinh.Text & ";" & txtquequan.Text
    End Sub

    Private Sub cmdtiep_Click()
    txthoten.Text = ""
    txtnamsinh.Text = ""
    txtquequan.Text = ""
    txthoten.SetFocus
    End Sub

    Private Sub cmdxoa_Click()
    Dim i
    Do While i <= List1.ListCount - 1
    If List1.Selected(i) = True Then
    List1.RemoveItem i
    Else
    i = i + 1
    End If
    Loop
    End Sub

    Bài 6: Quản lý nhân sự

    Bài tập lập trình VisualBasic Quan_l10

    Private Sub cmdPrevious_Click()
    Adodc1.Recordset.MovePrevious
    End Sub

    Private Sub cmdfirst_Click()
    Adodc1.Recordset.MoveFirst
    End Sub

    Private Sub cmdnext_Click()
    Adodc1.Recordset.MoveNext
    End Sub

    Private Sub cmdlast_Click()
    Adodc1.Recordset.MoveLast
    End Sub

    Private Sub cmdthem_Click()
    Adodc1.Recordset.AddNew
    txthoten.SetFocus
    End Sub

    Private Sub cmdcapnhat_Click()
    Adodc1.Recordset.Update
    End Sub

    Private Sub cmdsuadoi_Click()
    txthoten.Locked = False
    txtngaysinh.Locked = False
    txtlop.Locked = False
    txtquequan.Locked = False
    txtnghe.Locked = False
    End Sub

    Private Sub cmdxoa_Click()
    Adodc1.Recordset.Delete
    Adodc1.Recordset.MoveNext
    End Sub

    Bài 7: menu

    Bài tập lập trình VisualBasic Menu110

    Private Sub mnuchudo_Click()
    Text1.ForeColor = vbRed
    End Sub

    Private Sub mnuchuxanh_Click()
    Text1.ForeColor = vbBlue
    End Sub

    Private Sub mnuhien_Click()
    Text1.Visible = True
    End Sub

    Private Sub mnunenden_Click()
    Text1.BackColor = vbBlack
    End Sub

    Private Sub mnunenvang_Click()
    Text1.BackColor = vbYellow
    End Sub

    Private Sub mnutat_Click()
    Text1.Visible = False
    End Sub



    Bài 8: Máy tính

    Bài tập lập trình VisualBasic Maytin10

    Private Sub cmdchia_Click()
    txtketqua.Text = CInt(txtso1.Text) / CInt(txtso2.Text)
    End Sub

    Private Sub cmdcong_Click()
    txtketqua.Text = CInt(txtso1.Text) + CInt(txtso2.Text)
    End Sub

    Private Sub cmdnhan_Click()
    txtketqua.Text = CInt(txtso1.Text) * CInt(txtso2.Text)
    End Sub

    Private Sub cmdtru_Click()
    txtketqua.Text = CInt(txtso1.Text) - CInt(txtso2.Text)
    End Sub
    avatar
    anhtuan
    Trung Uý
    Trung Uý


    Tổng số bài gửi : 40
    Registration date : 07/07/2008

    Bài tập lập trình VisualBasic Empty Re: Bài tập lập trình VisualBasic

    Bài gửi by anhtuan Thu Jul 24, 2008 3:32 pm

    Đó là 1 số Code của môn lập trình VB6.0
    Anh em TH3A có thể tham khảo.
    Có gì không hiểu có thể hỏi với tôi:
    ĐT: 01234 770 693
    E-mail:tiengdanphudu_160388@yahoo.com
    hoặc emcothaidungkhaianhlabo_xinem@yahoo.com

    Chúc các bạn thành công trong kỳ thi sắp tới!!

    co viet nam
    hero_kute
    hero_kute
    ~²ºº8~ Admin ~²ºº8~
    ~²ºº8~ Admin ~²ºº8~


    Nam Tổng số bài gửi : 157
    Đến từ : Giữa hai đầu gối­
    Registration date : 15/01/2008

    Bài tập lập trình VisualBasic Empty Re: Bài tập lập trình VisualBasic

    Bài gửi by hero_kute Thu Jul 24, 2008 8:38 pm

    Tuấn ơi, chụp ảnh màn hình Post cả lên cho mọi người dễ hình dung. Vì chỉ có mã code khó làm lắm.....À cho cả đề bài đầy đủ đi. Edit lại bài đi nha
    Cảm ơn nhiều lắm Mad
    avatar
    anhtuan
    Trung Uý
    Trung Uý


    Tổng số bài gửi : 40
    Registration date : 07/07/2008

    Bài tập lập trình VisualBasic Empty Re: Bài tập lập trình VisualBasic

    Bài gửi by anhtuan Fri Jul 25, 2008 9:14 am

    tao biết là thế
    nhưng tao vẫn chưa post được ảnh
    tao chưa biết cách
    hero_kute
    hero_kute
    ~²ºº8~ Admin ~²ºº8~
    ~²ºº8~ Admin ~²ºº8~


    Nam Tổng số bài gửi : 157
    Đến từ : Giữa hai đầu gối­
    Registration date : 15/01/2008

    Bài tập lập trình VisualBasic Empty Re: Bài tập lập trình VisualBasic

    Bài gửi by hero_kute Fri Jul 25, 2008 1:17 pm

    Hix neeu' the' chup di gui qua mail tao Up len cho> ok
    avatar
    tranviet111
    —(••÷[Moderator]÷••)—
    —(••÷[Moderator]÷••)—


    Nam Tổng số bài gửi : 16
    Age : 37
    Đến từ : Thai Binh
    Registration date : 05/04/2008

    Bài tập lập trình VisualBasic Empty Qua la mot y kien hay

    Bài gửi by tranviet111 Fri Jul 25, 2008 8:46 pm

    Dung la mot y kien tuyet voi!
    thay mat ca lop xin cam on Anh Tuan nhieu!
    mong rang hay fat huy va jup do moi nguoi trong thoi gian con lai
    de TH3 tot nhiep 1 cach son se va thuan loi
    hero_kute
    hero_kute
    ~²ºº8~ Admin ~²ºº8~
    ~²ºº8~ Admin ~²ºº8~


    Nam Tổng số bài gửi : 157
    Đến từ : Giữa hai đầu gối­
    Registration date : 15/01/2008

    Bài tập lập trình VisualBasic Empty Re: Bài tập lập trình VisualBasic

    Bài gửi by hero_kute Tue Jul 29, 2008 12:06 am

    Da them anh vao de pa` kon de hinh` dung. Ok beauty

    Sponsored content


    Bài tập lập trình VisualBasic Empty Re: Bài tập lập trình VisualBasic

    Bài gửi by Sponsored content


      Hôm nay: Tue May 07, 2024 8:22 pm