Using checkboxes as a Radio buttons in VB form

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • santoshsri
    New Member
    • Jan 2007
    • 48

    Using checkboxes as a Radio buttons in VB form

    Hi,

    I have two checkboxes : Chkcities(0) and Chkcities(1) . I want that when user checks one box by single click other box should be unchecked and vice versa.
    I have used below code for this :
    Private Sub Chkcities_Click (Index As Integer)
    If Index = 0 Then
    Chkcities(1).va lue = vbUnchecked
    End If
    If Index = 1 Then
    Chkcities(0).va lue = vbUnchecked
    End If
    End Sub

    I am able to solve my purpose but problem is that; now user need to double click on boxes to check or uncheck them. Is there any way in VB6 by which I can make it driven by single click.

    Thanks
    Santosh
  • QVeen72
    Recognized Expert Top Contributor
    • Oct 2006
    • 1445

    #2
    Hi,

    It shud be :

    [code=vb]
    Private Sub Chkcities_Click (Index As Integer)
    If ChkCities(Index ).Value = vbChecked Then
    If Index = 0 Then
    Chkcities(1).va lue = vbUnchecked
    Exit Sub
    End If
    If Index = 1 Then
    Chkcities(0).va lue = vbUnchecked
    Exit Sub
    End If
    End If
    End Sub
    [/code]

    REgards
    Veena

    Comment

    • santoshsri
      New Member
      • Jan 2007
      • 48

      #3
      Hi Veena ,

      Thanks a ton .!! Your advice solved my purpose...
      One quick question.. Can we implement webservices in VB6 ? Actually we have an application made on VB6 and now we require to we add use some existing webservices ? Please let me know or If you can find some article on this , that will be of great help to me ..

      Cheers
      Santosh

      Comment

      • QVeen72
        Recognized Expert Top Contributor
        • Oct 2006
        • 1445

        #4
        Hi.

        Yes u can call webServices in VB6. Though personally, I have never done in any of my projects, but it can be done.
        do some googling for VB6 Webservices, u get so many links, just go thru them...


        REgards
        Veena

        Comment

        Working...