% % Dim a, b
A=3: b=4
Call s (a, b)
Print a, b
End Sub
Private Sub s (As an Integer x, y As an Integer)
X=x * 100
Y=y * 100
End Sub
CodePudding user response:
Add:Private Sub Command1_Click ()
Form_Click
End Sub
Or simply to
Private Sub Command1_Click ()
% % Dim a, b
A=3: b=4
Call s (a, b)
Print a, b
End Sub
CodePudding user response:
Your code:Form_Click () the process, is "click on the form" trigger event (in the form customer zone, no control click),
You click on the "button", but no corresponding code "events", of course look would be "no response",
In the forms designer, double-click the "button", VB6 code automatically pop-up window, to give you "set event procedure code framework",
You only need to the corresponding Privete Sub... End, between Sub need to write good code,
CodePudding user response:
It is recommended that you draw a button, and then click the button response code written,CodePudding user response:
If you have a form button control (for), you can click on the control must have no reaction, because of your statement is click form events,Put the content in the click event of the button control inside the
% % Dim a, b
A=3: b=4
Call s (a, b)
Print a, b
Private Sub Command1_Click ()
Here
End Sub
If you click the form namely originally, that is because the form the upper left corner the other controls keep out?
Or to Print a, b to Me. The Caption=a & amp; "/" & amp; B, according to the results to form the title on a try,
CodePudding user response:
Private Sub Form_Click ()% % Dim a, b
A=3: b=4
Call s (a, b)
Print a, b
End Sub
Private Sub s (byref x As an Integer, byref y As an Integer)
X=x * 100
Y=y * 100
End Sub
CodePudding user response:
The