Private Sub Command1_Click () Dim sum As Single, As a Single A=Text1 If a & gt; Then=2000 Sum=a + a * 0.1 The Else Sum=a + 1 Text2. Text=sum End the If End Sub
This code, click the command button, text box input a value greater than 1, 2000, a text box 2 cannot output?
CodePudding user response:
You only to the Else branch in output! The statement Text2. Text=End If the sum moved to behind,
CodePudding user response:
Can have no what, also do not see the Text2. Where is the Text=sum,
Change the following:
Private Sub Command1_Click () Dim sum As Single, As a Single A=CSNG (Text1. Text) If a & gt; Then=2000 Sum=a + a * 0.1 The Else Sum=a + 1 End the If Text2. Text=sum End Sub
CodePudding user response:
If no matter how much is the input, all want to be in Text2 output data, Is that your code has logic errors, the Text2. End if Text=sum moved to behind,
CodePudding user response:
Thank you, I see, I put the code under the simplified
Private Sub Command1_Click () Dim As a Single A=Text1 If a & gt; Then=2000 A=a + a * 0.1 The Else A=a + 1 End the If Text2=a End Sub
There is a problem a=Text1 with a=Text1. The meaning of the text is the same?
CodePudding user response:
The Text frame's "default property" is the Text property, Therefore: A=Text1 A=Text1. Text The two words of code are the same meaning,
However, I feel or to write a complete "object. The property is better," a look will understand which attributes, operations Don't need to "think about what should be the operation properties",
CodePudding user response:
The default kill people!
CodePudding user response:
Well, thank you! Sometimes encountered a=Val (text1. Text), why not use a=text1. The text?