lunaclover
Programmer
- Jun 22, 2005
- 54
Alright, this sounds easy enough, right?
Here's what I'm trying to do... I have several if/elseifs/elseif nested in other if/elseif/elseif conditionals. Once a model number is built (txtmodelnumber) it fills the textbox (whose text changes during run-time depending on which selections (a combination of radiobuttons and chkboxes))are made and displays (by enabling/disabling) certain available checkbox options (around 40).
Instead of writing a bunch of code based on other selections that generate the model number in the first place, I just want to be able to say
'if the first two characters of the model number are 'DM' (for example), then chk1.enabled = true, chk2.enabled = false, chk3.enabled = true, etc etc', and the checkboxes that are enabled/disabled will change depending on what the first two characters of the already built model number happen to be.
I have searched this site and others, so far I have tried,
txtModelNumber.text.equals(2) = "DM"
and
left(txtmodelnumber.text, 2) = "DM"
and a few other things I won't bore you with. My question - what is the correct format for doing this?
Thanks for your help or any direction you could give me.
Luna
Here's what I'm trying to do... I have several if/elseifs/elseif nested in other if/elseif/elseif conditionals. Once a model number is built (txtmodelnumber) it fills the textbox (whose text changes during run-time depending on which selections (a combination of radiobuttons and chkboxes))are made and displays (by enabling/disabling) certain available checkbox options (around 40).
Instead of writing a bunch of code based on other selections that generate the model number in the first place, I just want to be able to say
'if the first two characters of the model number are 'DM' (for example), then chk1.enabled = true, chk2.enabled = false, chk3.enabled = true, etc etc', and the checkboxes that are enabled/disabled will change depending on what the first two characters of the already built model number happen to be.
I have searched this site and others, so far I have tried,
txtModelNumber.text.equals(2) = "DM"
and
left(txtmodelnumber.text, 2) = "DM"
and a few other things I won't bore you with. My question - what is the correct format for doing this?
Thanks for your help or any direction you could give me.
Luna