Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: VB 6

  1. #1
    Join Date
    Jan 2007
    Posts
    5

    Default VB 6

    I can help in VB 6 if anyone needs help

  2. #2
    Join Date
    Mar 2007
    Posts
    8

    Default

    hahaha good old visual basic, i remember the days when my teacher taught us this stuff in computer class, man that was highly boreing hahaha

  3. #3
    Join Date
    Mar 2007
    Posts
    22

    Default Do while loops

    Our teacher has been giving us so much work for VBasic!
    i was asked to do loops and check em on VB can some1 check it for me plz

    i need it by tomoz plz..

    do while
    ========
    -----------------------
    Private Sub Command2_Click()
    Dim i As Integer

    Do While i < 100
    i = i + 1
    Loop


    lbl1.Caption = i

    End Sub
    ----------------------------

    can i also write the code in the following manner?

    ------------------------
    Private Sub Command3_Click()
    Dim i As Integer



    Do
    i = i + 1
    Loop While i < 100


    lbl1.Caption = i

    End Sub
    --------------------------------


    please let me know cuz i got even more

  4. #4
    Join Date
    Mar 2007
    Posts
    22

    Default if then else selections

    this is the Visual basics code
    please let me know if its correct


    ==================


    -------------------------------
    Private Sub Command4_Click()
    If txt1.Text = 1 Then
    lbl1.Caption = "You Typed Choice 1"
    Else
    If txt1.Text = 2 Then
    lbl1.Caption = "You Typed Choice 2"
    Else
    If txt1.Text = 3 Then
    lbl1.Caption = "You Typed Choice 3"
    Else
    If txt1.Text > 3 Then
    lbl1.Caption = "This choice is not available! Make ur choice from 1 to 3 ONLY!!"
    End If
    End If
    End If
    End If

    End Sub
    ---------------------------------------

  5. #5
    Join Date
    Mar 2007
    Posts
    22

    Default

    another part of my assessment was to do a do until loop, that was same as the do while i think, correct me if im wrong plz.

    code:
    --------------------------------
    Private Sub Command1_Click()
    Dim i As Integer


    Do Until i = 10
    i = i + 1
    Loop


    lbl1.Caption = i



    End Sub
    --------------------

  6. #6

    Default To j4f

    You Can write code as below you can use simply txt in place of txt.text
    If u want to convert it as number you must use type conversion like val()

    Private Sub Command4_Click()
    If txt1 = "1" Then lbl1.Caption = "You Typed Choice 1"
    If txt1= "2" Then lbl1.Caption = "You Typed Choice 2"
    If txt1= "3" Then lbl1.Caption = "You Typed Choice 3"
    If val(txt1) > 3 Then lbl1.Caption = "This choice is not available! Make ur choice from 1 to 3 ONLY!!"

  7. #7
    Join Date
    Jul 2007
    Posts
    9

    Default

    Select Case txt1.Text
    Case "1"
    lbl1.caption="You Typed Choice 1"
    Case "2"
    lbl1.caption="You Typed Choice 2"
    case "3"
    lbl1.caption="You Typed Choice 3"
    Else Case
    lbl1.Caption = "This choice is not available! Make ur choice from 1 to 3 ONLY!!"
    End Select

  8. #8
    Join Date
    Aug 2007
    Posts
    5

    Default i don't know

    i don't know

    Private Sub Command1_Click()
    List1.AddItem (Text1.Text)
    End Sub

  9. #9
    Join Date
    Aug 2007
    Posts
    5

    Default while

    Private Sub Command1_Click()
    Do While i <= 10
    List1.AddItem (i)
    i = i + 1
    Loop
    End Sub

  10. #10
    Join Date
    Aug 2007
    Posts
    5

    Default test

    Private Sub Text1_Change()
    Label1.Caption = Text1.Text
    End Sub

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •