这段程序看不懂,求高人帮忙解释一下,感激不尽 5
DimvAsBooleanDimsAsIntegerDimxAsDoubleDimyAsDoublePrivateSubCommand1_Click(IndexAsInt...
Dim v As Boolean
Dim s As Integer
Dim x As Double
Dim y As Double
Private Sub Command1_Click(Index As Integer)
If Form1.Tag = "s" Then
If Index = 10 Then
Text1.Text = "0."
Else
Text1.Text = Command1(Index).Caption
End If
Form1.Tag = ""
Else
Text1.Text = Text1.Text & Command1(Index).Caption
End If
End Sub
Private Sub Command2_Click(Index As Integer)
Form1.Tag = "s"
If v Then
x = Val(Text1.Text)
v = Not v
Else
y = Val(Text1.Text)
Select Case s
Case 0
Text1.Text = x + y
Case 1
Text1.Text = x - y
Case 2
Text1.Text = x * y
Case 3
If y <> 0 Then
Text1.Text = x / y
Else
MsgBox ("不能以0为除数")
Text1.Text = x
v = False
End If
Case 4
y = 0
v = False
End Select
x = Val(Text1.Text)
End If
s = Index
End Sub 展开
Dim s As Integer
Dim x As Double
Dim y As Double
Private Sub Command1_Click(Index As Integer)
If Form1.Tag = "s" Then
If Index = 10 Then
Text1.Text = "0."
Else
Text1.Text = Command1(Index).Caption
End If
Form1.Tag = ""
Else
Text1.Text = Text1.Text & Command1(Index).Caption
End If
End Sub
Private Sub Command2_Click(Index As Integer)
Form1.Tag = "s"
If v Then
x = Val(Text1.Text)
v = Not v
Else
y = Val(Text1.Text)
Select Case s
Case 0
Text1.Text = x + y
Case 1
Text1.Text = x - y
Case 2
Text1.Text = x * y
Case 3
If y <> 0 Then
Text1.Text = x / y
Else
MsgBox ("不能以0为除数")
Text1.Text = x
v = False
End If
Case 4
y = 0
v = False
End Select
x = Val(Text1.Text)
End If
s = Index
End Sub 展开
1个回答
展开全部
这是MFC里面定义的消息映射,斜杠部分不做解释了,本来就是注释
BEGIN_MESSAGE_MAP(CPApp, CWinApp) //消息映射起始
ON_COMMAND(ID_APP_ABOUT, OnAppAbout) //名字为ID_APP_ABOUT的按钮按下去之后响应OnAppAbout函数
ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew) //名字为ID_FILE_NEW的按钮按下去之后响应CWinApp::OnFileNew函数
ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)//名字为ID_FILE_OPEN的按钮按下去之后响应CWinApp::OnFileOpen函数
ON_COMMAND(ID_FILE_PRINT_SETUP,CWinApp::OnFilePrintSetup) //名字为ID_FILE_PRINT_SETUP的按钮按下去之后响应CWinApp::OnFilePrintSetup函数
END_MESSAGE_MAP() //消息映射定义结束
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
中智咨询
2024-08-28 广告
2024-08-28 广告
在当今竞争激烈的商业环境中,企业需要不断提高自身的竞争力,以保持市场份额和增加利润。通过人效提升,企业可以更有效地利用有限的资源,提高生产力和效益,从而实现盈利目标。中智咨询提供全方位的组织人效评价与诊断、人效提升方案等数据和管理咨询服务。...
点击进入详情页
本回答由中智咨询提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询