ETO Forms and de activate text box

How can I disable / hide whatever text box label 4 if Radio button index is 1 and keep it active if index is 0.

class GeoAssociateDialog(forms.Dialog[bool]):
    
    # Dialog box Class initializer
    def __init__(self):
        # Initialize dialog box
        self.Title = "Geo Surface Vectors"
        self.Padding = drawing.Padding(10)
        self.Resizable = False
        
        
        # Create Radio Button List Control
        self.m_radiobuttonlist = forms.RadioButtonList()
        self.m_radiobuttonlist.DataStore = ['No Plane', 'Fit Plane']
        self.m_radiobuttonlist.Orientation = forms.Orientation.Horizontal
        self.m_radiobuttonlist.SelectedIndex = 0
        
        # Create controls for the dialog
        self.m_label1 = forms.Label(Text = 'Job Number:')
        self.m_JobNum_textbox = forms.TextBox(Text = "SC-000")
        #self.m_JobNum_textbox = forms.TextBox(Text = "")
        
        self.m_label2 = forms.Label(Text = 'New Layer:')
        self.m_NewLayer_textbox = forms.TextBox(Text = "Surface Vectors")
        #self.m_NewLayer_textbox = forms.TextBox(Text = "")
        
        self.m_label3 = forms.Label(Text = 'Range mm:')
        self.m_Range_textbox = forms.TextBox(Text = "")
        
        self.m_label4 = forms.Label(Text = 'Thickness mm:')
        self.m_Thickness_textbox = forms.TextBox(Text = "")
        
        self.m_label5 = forms.Label(Text = 'Font Size mm:')
        self.m_Font_textbox = forms.TextBox(Text = "")
        
        self.m_label6 = forms.Label(Text = 'Vector Scale:')
        self.m_VectScale_textbox = forms.TextBox(Text = "3")
        
        self.m_label7 = forms.Label(Text = 'Tol mm:')
        self.m_Tol_textbox = forms.TextBox(Text = "8")        
        
        self.m_label8 = forms.Label(Text = 'Model Space Scale:')
        self.m_ModScale_textbox = forms.TextBox(Text = "15")    

Do you know how to connect to events?

You’ll probably want to subscribe to CheckedChange and enable/disable/hide/show controls when that fires.

RadioButton Class (picoe.ca)
This also briefly discusses how to handle radiobuttons when they’re linked, which is what I assume is behind the scenes for your forms.radiobuttonlist() call.

1 Like

Many thanks will give it a go.