Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.

Radio Button

edited October 2023 in OpenInsight
Is there any way to programatically Get (and Set) the Button Labels on a Radio Button control?
I have looped through all the properties for a Radio Button and it seems the answer might be no.

This was my source list: Properties

Comments

  • Given that the labels on a radio button form part of the ctrlentid, for some properties at least, my gut feel is no
  • Actually, the answer is yes and no. The CtrlEntId of the radio button (not simply the radio group) won't be changed nor will the VALUE property for the radio group, but you can change the TEXT property of a button:
    Set_Property(@Window : '.RADIO.RADIO_1', 'TEXT', 'Video 1')
    Something else to keep in mind is that if you change the TEXT and it is wider than the original text, it will appear truncated. In this case you will need to change the SIZE of the control as well.
  • in OI10 you can:

    BUTTONS property (RadioGroup)
    Description

    Provides indexed access to the individual RADIOBUTTON controls, or direct access to the entire button structure as an array.



    Property Value

    When used without an index the BUTTONS property value is a dynamic array of button information with the following format:



    <1> Button Labels (@vm delimited array)

    <2> Button Values (@vm delimited array)



    Fields <1> and <2> (the Labels and Values) form an AMV group.



    When used with an index the BUTTONS property value is not applicable because it acts as a reference point to the specified RADIOBUTTON instead.



    Property Traits



    Development

    Runtime

    Indexed

    Scaled

    Synthetic

    Get/Set

    Get/Set

    ButtonPosition,ButtonLabel

    No

    No



    Remarks

    At runtime an individual button may be referenced via an index value using the normal Get/Set_Property index parameter. The index value may the Label of the button (case-insensitive) or the position of the button.



    Example
  • First things first. Appreciate all the quick responses. Much appreciated.

    Secondly. Don for the win...again. Tested and behaves EXACTLY as Don said it would. (why do I even bother testing???)

    Finally, Interesting changes in OI 10 that Barry pointed out.
Sign In or Register to comment.