Home > Software engineering >  For bosses to look at
For bosses to look at

Time:09-17

The code below
Private Sub Command1_Click ()
If Combo1. Text="large And less disease spot, a spindle streak, grey, brown to orange, no wheel grain" And Combo2. Text="is no phenomenon" And Combo3. Text="no phenomenon" Then
Combo4. Text="spot"
End the If
End Sub
The first three terms are by drop-down list box

CodePudding user response:

I ordered a command button, comboBox4

CodePudding user response:

If "no response", that just means:
Your Combo1 Combo3, there must be a text content is not consistent with the given,

See you this "style", in front of the three "representations" only some projects from the given choices, not arbitrary input!
If so, suggest you window design the "drop-down list control" of the Style attribute is set to 2 - Dropdown can,
Then, "judge" there, to make judgment on the ListIndex, don't have to be judged by the Text,

For example:
 Private Sub Command1_Click () 
If Combo1. ListIndex=1 And Combo2. ListIndex=0 And Combo3. ListIndex=0 Then
'Combo4. Text="spot"
Combo4. ListIndex=2 'item 3: "spot"
End the If
End Sub

A drop-down list of ListIndex begins with 0, item 1 ListIndex=0; Item 2 ListIndex=1; .
The above code, I will give ListIndex value only the "signal", according to your actual condition to select,
Read ListIndex attribute values, can be judged "which chose", in "no option," ListIndex=1;
Set ListIndex attribute values, is a choice,
If set to 1, it says "don't choose," control "displays the text" there will be a blank,

And:
Change the nature of the Style, as I've told you want to use the Text content, also can be used;
To select a "", also can use a" text assignment "on the way to operation,
Such as: Combo4. Text="spot"
Also can write, but the requirement is in Combo4 must have a "big spot", otherwise it will produce operation error,

CodePudding user response:

String, try not to use to judge,
If you is this homework assignments or small pilot project, each word to check for wrong,
If you want to do real projects, each symptom are expressed in the code in the database, each code to control the corresponding text, including your judgment in code, even judge rules make it configuration,
In this way, the adjustment of the text, the adjustment of the judgment rules, and so on are only need to adjust the data, do not need to adjust the code,

CodePudding user response:

refer to the second floor a toast to invite the bright moon response:
if "no response", that just means:
Your Combo1 Combo3, there must be a text content is not consistent with the given,

See you this "style", in front of the three "representations" only some projects from the given choices, not arbitrary input!
If so, suggest you window design the "drop-down list control" of the Style attribute is set to 2 - Dropdown can,
Then, "judge" there, to make judgment on the ListIndex, don't have to be judged by the Text,

For example:
 Private Sub Command1_Click () 
If Combo1. ListIndex=1 And Combo2. ListIndex=0 And Combo3. ListIndex=0 Then
'Combo4. Text="spot"
Combo4. ListIndex=2 'item 3: "spot"
End the If
End Sub

A drop-down list of ListIndex begins with 0, item 1 ListIndex=0; Item 2 ListIndex=1; .
The above code, I will give ListIndex value only the "signal", according to your actual condition to select,
Read ListIndex attribute values, can be judged "which chose", in "no option," ListIndex=1;
Set ListIndex attribute values, is a choice,
If set to 1, it says "don't choose," control "displays the text" there will be a blank,

And:
Change the nature of the Style, as I've told you want to use the Text content, also can be used;
To select a "", also can use a" text assignment "on the way to operation,
Such as: Combo4. Text="spot"
Also can write, but the requirement is in Combo4 must have a "big spot", otherwise it will produce operation error,

Thank you hand in your homework in an hour, from struggled last night to now, thank you very much!

CodePudding user response:

reference 4 floor qq_41274591 response:
Quote: refer to the second floor a toast to invite the bright moon response:
if "no response", that just means:
Your Combo1 Combo3, there must be a text content is not consistent with the given,

See you this "style", in front of the three "representations" only some projects from the given choices, not arbitrary input!
If so, suggest you window design the "drop-down list control" of the Style attribute is set to 2 - Dropdown can,
Then, "judge" there, to make judgment on the ListIndex, don't have to be judged by the Text,

For example:
 Private Sub Command1_Click () 
If Combo1. ListIndex=1 And Combo2. ListIndex=0 And Combo3. ListIndex=0 Then
'Combo4. Text="spot"
Combo4. ListIndex=2 'item 3: "spot"
End the If
End Sub

A drop-down list of ListIndex begins with 0, item 1 ListIndex=0; Item 2 ListIndex=1; .
The above code, I will give ListIndex value only the "signal", according to your actual condition to select,
Read ListIndex attribute values, can be judged "which chose", in "no option," ListIndex=1;
Set ListIndex attribute values, is a choice,
If set to 1, it says "don't choose," control "displays the text" there will be a blank,

And:
Change the nature of the Style, as I've told you want to use the Text content, also can be used;
To select a "", also can use a" text assignment "on the way to operation,
Such as: Combo4. Text="spot"
Also can write, but the requirement is in Combo4 must have a "big spot", otherwise it will produce operation error,

Thank you hand in your homework in an hour, from struggled last night to now, thank you very much!

If the problem solving, and stick it,

CodePudding user response:

Next time this kind of problem can add a breakpoint to look at ourselves, small problem
  • Related