• 软件测试技术
  • 软件测试博客
  • 软件测试视频
  • 开源软件测试技术
  • 软件测试论坛
  • 软件测试沙龙
  • 软件测试资料下载
  • 软件测试杂志
  • 软件测试人才招聘
    暂时没有公告

字号: | 推荐给好友 上一篇 | 下一篇

asp.net 实现“九连环”小游戏

发布: 2007-6-30 23:38 | 作者: admin | 来源: | 查看: 15次 | 进入软件测试论坛讨论

领测软件测试网 wildcatsky(原作)

public Class ChinaRing1
Inherits System.Web.UI.Page

#Region " Web 窗体设计器生成的代码 "

@#该调用是 Web 窗体设计器所必需的。
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()

End Sub
Protected WithEvents ChinaRingCkBox1 As System.Web.UI.WebControls.CheckBox
Protected WithEvents ChinaRingCkBox2 As System.Web.UI.WebControls.CheckBox
Protected WithEvents ChinaRingCkBox3 As System.Web.UI.WebControls.CheckBox
Protected WithEvents ChinaRingCkBox4 As System.Web.UI.WebControls.CheckBox
Protected WithEvents ChinaRingCkBox5 As System.Web.UI.WebControls.CheckBox
Protected WithEvents ChinaRingCkBox6 As System.Web.UI.WebControls.CheckBox
Protected WithEvents ChinaRingCkBox7 As System.Web.UI.WebControls.CheckBox
Protected WithEvents ChinaRingCkBox8 As System.Web.UI.WebControls.CheckBox
Protected WithEvents ChinaRingCkBox9 As System.Web.UI.WebControls.CheckBox
Protected WithEvents ChinaRingLb1 As System.Web.UI.WebControls.Label
Protected ChinaRingCkBox(8) As System.Web.UI.WebControls.CheckBox


@#注意: 以下占位符声明是 Web 窗体设计器所必需的。
@#不要删除或移动它。
Private designerPlaceholderDeclaration As System.Object

Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
@#CODEGEN: 此方法调用是 Web 窗体设计器所必需的
@#不要使用代码编辑器修改它。
InitializeComponent()
End Sub

#End Region


Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
ChinaRingCkBox(0) = ChinaRingCkBox1
ChinaRingCkBox(1) = ChinaRingCkBox2
ChinaRingCkBox(2) = ChinaRingCkBox3
ChinaRingCkBox(3) = ChinaRingCkBox4
ChinaRingCkBox(4) = ChinaRingCkBox5
ChinaRingCkBox(5) = ChinaRingCkBox6
ChinaRingCkBox(6) = ChinaRingCkBox7
ChinaRingCkBox(7) = ChinaRingCkBox8
ChinaRingCkBox(8) = ChinaRingCkBox9
End Sub

Private Sub ChinaRingCkBox1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ChinaRingCkBox1.CheckedChanged
ChinaRingCkBox_CheckedChanged(1, sender, e)
End Sub

Private Sub ChinaRingCkBox2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ChinaRingCkBox2.CheckedChanged
ChinaRingCkBox_CheckedChanged(2, sender, e)
End Sub

Private Sub ChinaRingCkBox3_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ChinaRingCkBox3.CheckedChanged
ChinaRingCkBox_CheckedChanged(3, sender, e)
End Sub

Private Sub ChinaRingCkBox4_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ChinaRingCkBox4.CheckedChanged
ChinaRingCkBox_CheckedChanged(4, sender, e)
End Sub

Private Sub ChinaRingCkBox5_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ChinaRingCkBox5.CheckedChanged
ChinaRingCkBox_CheckedChanged(5, sender, e)
End Sub

Private Sub ChinaRingCkBox6_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ChinaRingCkBox6.CheckedChanged
ChinaRingCkBox_CheckedChanged(6, sender, e)
End Sub

Private Sub ChinaRingCkBox7_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ChinaRingCkBox7.CheckedChanged
ChinaRingCkBox_CheckedChanged(7, sender, e)
End Sub

Private Sub ChinaRingCkBox8_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ChinaRingCkBox8.CheckedChanged
ChinaRingCkBox_CheckedChanged(8, sender, e)
End Sub

Private Sub ChinaRingCkBox9_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ChinaRingCkBox9.CheckedChanged
ChinaRingCkBox_CheckedChanged(9, sender, e)
End Sub

Private Sub ChinaRingCkBox_CheckedChanged(ByVal index As Integer, ByVal sender As System.Object, ByVal e As System.EventArgs)
Dim i As Integer
i = 0
Dim ChinaRingCk As Boolean = False
If index = 1 Then
ChinaRingCk = True
Else
If ChinaRingCkBox(index - 2).Checked Then
ChinaRingCk = True
End If
Do While i < index - 2
If ChinaRingCkBox(i).Checked Then
ChinaRingCk = False
End If
i = i + 1
Loop
End If
If Not ChinaRingCk Then
ChinaRingCkBox(index - 1).Checked = Not ChinaRingCkBox(index - 1).Checked
@#可以在这里加一个提示,根据条件提示不能套入,或不能拿出该环。
End If
End Sub

End Class



文章来源于领测软件测试网 https://www.ltesting.net/


关于领测软件测试网 | 领测软件测试网合作伙伴 | 广告服务 | 投稿指南 | 联系我们 | 网站地图 | 友情链接
版权所有(C) 2003-2010 TestAge(领测软件测试网)|领测国际科技(北京)有限公司|软件测试工程师培训网 All Rights Reserved
北京市海淀区中关村南大街9号北京理工科技大厦1402室 京ICP备2023014753号-2
技术支持和业务联系:info@testage.com.cn 电话:010-51297073

软件测试 | 领测国际ISTQBISTQB官网TMMiTMMi认证国际软件测试工程师认证领测软件测试网