IntroductiontoComputerProgramming.pptVIP

  • 2
  • 0
  • 约6.15千字
  • 约 37页
  • 2017-02-27 发布于湖北
  • 举报
IntroductiontoComputerProgramming

9.5 Boa-constructor 5. 显示框架设计器 9.5 Boa-constructor 6. 添加控件 9.5 Boa-constructor 7. 修改控件属性 9.5 Boa-constructor 8. 为按钮添加单击事件处理函数 9.5 Boa-constructor 9. 在按钮的事件处理函数中编写代码 在编辑器窗口中单击“源”页,显示出代码。在刚才添加的事件处理函数OnButton1Button( )内用下列代码替换该处的“event.Skip()”语句: operator=self.cmb1.GetValue( ) #获得cmb1中的字符串 x=self.textCtrl1.GetValue( ) #获得textCtrl1中的字符串 y=self.textCtrl2.GetValue( ) #获得textCtrl2中的字符串 x=float(x) y=float(y) if operator==+: z=x+y if operator==-: z=x-y if operator==*: z=x*y if operator==/: z=x/y self.textCtrl3.SetValue(str(z))

文档评论(0)

1亿VIP精品文档

相关文档