Hi, I have an application where I have a Tabbed Notebook component and each tab contains an identical set of components. These are 10 rows of 1 Combobox and 3 Editboxes. I need to change which Editboxes are enabled based on the selection in that row's Combobox. So far, I have the following shared event handler that all of the comboboxes use:
The value of 'no' will be of the form xy, where x is the tab number and y is the row number. Basically, the lines with edtMin11 and edtMax11 need to actually be changing editMinxy and editMaxxy. I've tried
((edtMin+no) As TEdit).Enabled
but this doesn't work, the only other way I have in my box of tricks is to check the name of every component on the form and modify the right one when I find it, but that seems too much of a brute force approach for me to use it if there's another option.
So, anyone know how to do this?
Code:
var
no:string;
begin
no := Copy((Sender As TComboBox).Text,8,2);
If Copy((Sender As TComboBox).Text,1,6) = 'String' then
begin
edtMin11.Enabled := False;
edtMax11.Enabled := True;
end;
end;
The value of 'no' will be of the form xy, where x is the tab number and y is the row number. Basically, the lines with edtMin11 and edtMax11 need to actually be changing editMinxy and editMaxxy. I've tried
((edtMin+no) As TEdit).Enabled
but this doesn't work, the only other way I have in my box of tricks is to check the name of every component on the form and modify the right one when I find it, but that seems too much of a brute force approach for me to use it if there's another option.
So, anyone know how to do this?