dcsimg
Results 1 to 3 of 3

Thread: VB - An ActiveX control which supplies a pair of Yes/No Option Buttons

  1. #1

    Thread Starter
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,098

    VB - An ActiveX control which supplies a pair of Yes/No Option Buttons

    I had occasion to write an application where a large number of Yes/No questions needed to be answered by the user. To make the coding for that project easier I wrote this little ActiveX control which is a pair of Option Buttons labeled Yes and No. I added the following four properties:

    OptNoEnabled - Enable or disable the "No" choice
    OptNoValue - Set the "No" value
    OptYesEnabled - Enable or disable the "Yes" choice
    OptYesValue - Set the "Yes" value

    The code for the control is included in the zip file.
    Attached Files Attached Files

  2. #2
    Hyperactive Member
    Join Date
    Aug 2011
    Location
    Palm Coast, FL
    Posts
    293

    Re: VB - An ActiveX control which supplies a pair of Yes/No Option Buttons

    Currently you've got the "Yes" and "No" option button captions hard-coded but with a neat little trick you can quickly localize this control to display the local language versions of "Yes" and "No".

    Code:
    Dim strYes as String
    Dim strNo  as String
    
    Const FORMAT_STRING_YESNO          As String = "Yes/No"
    
    strYes = Format$(True, FORMAT_STRING_YESNO)
    strNo = Format$(False, FORMAT_STRING_YESNO)
    
    optYes.Caption = strYes
    optNo.Caption = strNo
    Last edited by AAraya; May 24th, 2019 at 08:05 AM.

  3. #3

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width