3 Replies Latest reply on Oct 24, 2014 11:12 AM by Jerry Wolverton

    How can I select a radio button on data card with api, preferrably in vb.net

    Jerry Wolverton

      I have three radio buttons on my data card linked to the same variable.  I can manually select the different radio buttons to change the variable value, but I would like to add that control to an api I am writing for my addin.  Is there a way to control which radio button is selected through api's?

       

      Jerry

        • Re: How can I select a radio button on data card with api, preferrably in vb.net
          Ar K

          For selecting :

          radiobutton1.checked=true

           

          for control:

          if radiobutton1.checked=true Then

          '...

          elseif radiobutton2.checked=true Then

          '...

          radiobutton3.checked=true Then

          '...

          End if

           

          Or

           

          For Each obj As Object In Me.Controls

                  If obj.Name.Contain("radio") Then

                        if obj.checked=true Then

                                '...

                        End if

                   End If

          Next

            • Re: How can I select a radio button on data card with api, preferrably in vb.net
              Jerry Wolverton

              Thanks for the reply, Ar K

              Sorry for the late reply.  I got bumped off this project but am not back on it.  I have since been able to detect the radio button, but I cannot find a way to activate it.

               

              It looks like I should have been clearer in my question.  Looks like you are referring to a custom made windows form, but what I meant by "data card" was the EPDM data card.  So I do not know what the radio button's call name is upfront because I did not create the card with code, but rather used the EPDM card creator and dragged and dropped the radio buttons in.

               

              That all being said, I have been able to find the radio button of interest on the data card, but can't find a way to activate it.  My code to find it is:

               

              swFile = v.GetFileFromPath(swPathName, swFolder)
              dataCard = swFolder.GetCard("slddrw")
              ctrlPos = dataCard.GetFirstControlPosition
              While Not ctrlPos.IsNull
              dataCardCtrl = dataCard.GetNextControl(ctrlPos)
                   ctrlType = dataCardCtrl.ControlType

                   If ctrlType = EdmCardControlType.EdmCtrl_RadioColumn Then
                        If dataCardCtrl.Name = "Part" Then
                             str = ""
                             str = "Card Control: " & dataCardCtrl.Name
                             str = str & vbLf + "Control ID:" & dataCardCtrl.ID
                             str = str & vbLf + "Variable ID:" & dataCardCtrl.VariableID
                             str = str & vbLf + "Control Type:" & ctrlType
                             MsgBox(str)
                             '*** found the radio button, but do not know how to activate it!!!***

                        End If
                   End If
              End While

            • Re: How can I select a radio button on data card with api, preferrably in vb.net
              Jerry Wolverton

              Just to put closure to this question, I decided to skip over the step of trying to call to the Data Card to preform a task, and jump right to the variables that the task would have impacted and changed them directly.  So, I changed my method of solving the problem and therefore do not need to manipulate the Data Card radio buttons.