Results 1 to 4 of 4

Thread: [RESOLVED] random name

  1. #1

    Thread Starter
    Hyperactive Member jp26198926's Avatar
    Join Date
    Sep 2008
    Location
    General Santos City, Philippines
    Posts
    310

    Resolved [RESOLVED] random name

    hello.

    i have: 1 listbox, 1 label and 1 command button

    there are 5 names in listbox

    and i want is:

    command1_click()
    label1.caption = rnd * list1.list(name)
    end sub

    something like that...but i dont know how?


    thanks in advance

    ☻ jaypee ☻

  2. #2
    Frenzied Member longwolf's Avatar
    Join Date
    Oct 2002
    Posts
    1,343

    Re: random name

    try this
    Code:
    Private Sub command1_Click()
        label1.Caption = list1.List(Int(list1.ListCount * Rnd))
    End Sub
    P.S. doing it this way should work no mater how many names you add.

  3. #3

    Thread Starter
    Hyperactive Member jp26198926's Avatar
    Join Date
    Sep 2008
    Location
    General Santos City, Philippines
    Posts
    310

    Re: random name

    thanks...for the help

  4. #4
    Frenzied Member longwolf's Avatar
    Join Date
    Oct 2002
    Posts
    1,343

    Re: [RESOLVED] random name

    You're welcome.
    Do you understand how it works?

Posting Permissions

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



Click Here to Expand Forum to Full Width