CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: List box

  1. #1
    Join Date
    Jul 2001
    Posts
    6

    List box

    I have a list box in my app with the style set as checkbox.

    Q - how do I get some of my checkboxs to be already ticked when my form is shown to the user? I need this to represent default options.

    Thanks

    Jas


  2. #2
    Join Date
    Apr 2000
    Location
    South Carolina,USA
    Posts
    2,210

    Re: List box


    option Explicit

    private Sub Form_Load()
    Dim X
    for X = 0 to 10
    List1.AddItem X
    next X
    List1.Selected(1) = true ' set item one as checked
    End Sub




    John G

  3. #3
    Join Date
    Jul 2001
    Posts
    6

    Re: List box

    Thanks John. Obvious when you see the code :-)


  4. #4
    Join Date
    Apr 2000
    Location
    South Carolina,USA
    Posts
    2,210

    Re: List box

    The ListBOx control does not follow the normal rules, hence the confusion. I, as well as many others, find it confusing.

    John G

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