把Form_Load()里的代码,换个地方!Private Sub Command1_Click() Dim width As Double, h As Double width = Val(InputBox("请输入宽度")) h = Val(InputBox("请输入高度")) Print Print "宽度:"; width Print "高度:"; h
Call rectArea(width, h) rectArea width, hEnd SubPrivate Sub Form_Load()End SubPublic Sub rectAr...
你的程序放的事件不对,可能因为Form_Load事件发生时窗体还没有形成,所以Print没有反应。你可以将Form_Load中的代码剪切到Command1_Click事件中,或者也可以放到Form_Activate事件中。另外,你可能多调用了一次rectArea过程,导致结果输出了两次。示例如下:Private Sub Form_Activate()Di...