Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: VB4,VB5,VB6
Expertise: beginner
Jun 13, 2002

GetSelectedOption - Get the selected element in an OptionButton control array

' Determine which element of an option button control array was selected
' Returns -1 if no control has been selected

' Use : OptSelected = GetSelectedOption(Option1)

Function GetSelectedOption(Opt As Object) As Integer
    Dim i As Integer

    GetSelectedOption = -1

    For i = Opt.LBound To Opt.UBound
        If Opt(i).Value Then
            GetSelectedOption = i
            Exit For
        End If
    Next
End Function

Wim De Smet
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap