CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    May 1999
    Posts
    41

    Automating number generation in a Combobox

    I am trying to populate a combo box with no's 1 to 100. What's the best way of add this text to combo box w/o typing
    cmbNo.Additem "1"
    cmbNo.Additem "2" etc. till 100. i.e. I want to automate the no. generation

    Sorry for my ignoreance but your help is much appreciated.




  2. #2
    Join Date
    Aug 2001
    Posts
    5

    Re: Automating number generation in a Combobox

    I would use a for next loop as follows:
    Str will convert the integer into a string
    Dim a as integer
    for a = 1 to 100
    cmbNo.Additem str(a)
    Next a


  3. #3
    Join Date
    May 1999
    Posts
    41

    Thank you

    hi,
    Thank you for your help..It works fine..


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

Featured