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

Thread: CHECK BOX

  1. #1
    Join Date
    Jan 2000
    Posts
    6

    CHECK BOX

    I'M NEW TO VISUAL BASIC, I HAVE A FORM WITH 12 CHECK BOXES NUMBERED 1 - 12 I NEED A RESULT BOX TO DISPLAY WHICH NUMBERS I HAVE CLICKED AND A WAY TO STORE THESE RESULTS CAN SOMEONE HELP ME


  2. #2
    Join Date
    Sep 1999
    Location
    Red Wing, MN USA
    Posts
    312

    Re: CHECK BOX


    private Sub cmdResults_Click()
    Dim oControl as Control
    Dim sResult as string

    for Each oControl In Controls
    If TypeOf oControl is CheckBox then
    If oControl.Value then sResult = sResult & ", " & oControl.Name
    End If
    next
    MsgBox "You Checked; " & mid$(sResult, 3)
    End Sub



    You could store the Result(s) in the Registry using the VB Functions GetSetting() and SaveSetting()

    Aaron Young
    Analyst Programmer
    [email protected]
    [email protected]
    Aaron Young
    Senior Programmer Analyst (Red Wing Software)
    Certified AllExperts Expert

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