VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



A ten-line function that returns the index of a selected OptionButton in a collection. i.e : s = fn

by Christian BAY (2 Submissions)
Category: Custom Controls/Forms/Menus
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Mon 10th September 2001
Date Added: Mon 8th February 2021
Rating: (1 Votes)

A ten-line function that returns the index of a selected OptionButton in a collection. i.e : s = fnGetOptButtonChecked(Option1)

Rate A ten-line function that returns the index of a selected OptionButton in a collection. i.e : s = fn




    Dim octrTemp As OptionButton
    
    fnGetOptButtonChecked = -1
    
    For Each octrTemp In optButtonCollection
        If octrTemp.Value = True Then
            fnGetOptButtonChecked = octrTemp.Index
            Exit For
        End If
    Next

End Function


Download this snippet    Add to My Saved Code

A ten-line function that returns the index of a selected OptionButton in a collection. i.e : s = fn Comments

No comments have been posted about A ten-line function that returns the index of a selected OptionButton in a collection. i.e : s = fn. Why not be the first to post a comment about A ten-line function that returns the index of a selected OptionButton in a collection. i.e : s = fn.

Post your comment

Subject:
Message:
0/1000 characters