MFC课程设计报告彩票自动选号系统.doc

上传人:文库蛋蛋多 文档编号:2385635 上传时间:2023-02-17 格式:DOC 页数:45 大小:102KB
返回 下载 相关 举报
MFC课程设计报告彩票自动选号系统.doc_第1页
第1页 / 共45页
MFC课程设计报告彩票自动选号系统.doc_第2页
第2页 / 共45页
MFC课程设计报告彩票自动选号系统.doc_第3页
第3页 / 共45页
MFC课程设计报告彩票自动选号系统.doc_第4页
第4页 / 共45页
MFC课程设计报告彩票自动选号系统.doc_第5页
第5页 / 共45页
点击查看更多>>
资源描述

《MFC课程设计报告彩票自动选号系统.doc》由会员分享,可在线阅读,更多相关《MFC课程设计报告彩票自动选号系统.doc(45页珍藏版)》请在三一办公上搜索。

1、MFC编程及应用课程设计报告题目: 彩票自动选号系统 学号: 1004220327 姓名: 李康 指导老师: 杨均匀 时间: 2011年10月7日 评语:1、设计步骤(1) 工程建立建立基于对话框的应用程序(2) 类中新增变量的作用1、 在资源中增加两个对话框,并建立类向导,创建两个类CPage1,CPage2.2、 增加类Cli1004220327在后面静态成员变量关联起来3、 在类CPage1中增加m_num1,m_num2,.m_num35与对话框中的静态文本关联起来,也就是彩票的数字.4、 在对话框中增加五个单选按钮,用来选择投注数,当选择第一注时,变量m_touzhu1=0,选择第二

2、注时m_touzhu1=1,依此类推5、 对话框中的开始按钮,增加关联函数OnStart(),当m_touzhu1=-1时,表示没有投注,用MessageBox弹出对话框提示请投注,当m_touzhu1=0时,即表示投一注,在设置定时器时,只设置7个,当m_touzhu1=1时,定时器设置14个。SetTimer(i,1,NULL);i表示定时器的名字,中间的1表示间隔1ms,NULL表示空,用for循环依次设置定时器6、 增加消息函数,TIMER,设置定时器响应的函数,当m_touzhu1=0时,表示设置了7个定时器,int型i用来随机产生一个很大的整数,语句i = rand()%10用来随

3、机产生一个小于10的整数,也就是我们所看到的彩票,语句str.Format(%i,i);m_num1.SetWindowText(str);是将产生的整数i转换成CString型,后面代码的功能基本是一样的。7、 类CPage1的OnStop()函数的功能是来结束定时器,同样,当m_touzhu1=0时,只产生7个定时器,KillTimer(i)的i是指定时器的名字,用for循环来结束每个定时器。当m_touzhu1=1,2,3,4时,依此类推8、 类CPage1中OnQinglimg()函数的功能是将所有的彩票号码变为0,m_num1.SetWindowText(0);可以实现该功能。9、

4、类CPage1中OnCtlColor()函数是用来控制彩票号码的顔色,pDC-SetTextColor(RGB(0,0,255);来控制颜色。10、 在类CPage1中增加CFont m_font1;变量,再通过语句m_font1.CreateFont(-24,-20,0,0,100,0,0,0,DEFAULT_CHARSET,OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY,FF_ROMAN,宋体);来控制字体的大小和形状。11、 在类CPage1中OnAuto()函数是用来自动产生一组彩票,点击一下自动按钮时,彩票自动选号系统开始

5、自动选票,然后再点击一下时,彩票选号系统停止,随机产生一组彩票,这个功能和我开始想的有出入,我开始以为是点击一下就实现自动选号的功能。 if(k=0) OnStart(); k=1; else if(k=1) OnStop(); k=0; 定义一k在中间传递,变换的调用OnStart();和OnStop()函数,实现自动选号的功能。12、类CPage2和CPage1中各个函数的功能基本相同,只是在两个地方有细小不同,i = rand()%36;if (i9&i36)str.Format(%i,i);m_num36.SetWindowText(str);else if(i9&i36)str.Fo

6、rmat(%i,i);m_num36.SetWindowText(str);else if(i9&i36)str.Format(%i,i);m_num37.SetWindowText(str);else if(i9&i36)str.Format(%i,i);m_num38.SetWindowText(str);else if(i9&i36)str.Format(%i,i);m_num39.SetWindowText(str);else if(i9&i36)str.Format(%i,i);m_num40.SetWindowText(str);else if(i9&i36)str.Format(

7、%i,i);m_num41.SetWindowText(str);else if(i9&i36)str.Format(%i,i);m_num42.SetWindowText(str);else if(i9&i36)str.Format(%i,i);m_num36.SetWindowText(str);else if(i9&i36)str.Format(%i,i);m_num37.SetWindowText(str);else if(i9&i36)str.Format(%i,i);m_num38.SetWindowText(str);else if(i9&i36)str.Format(%i,i)

8、;m_num39.SetWindowText(str);else if(i9&i36)str.Format(%i,i);m_num40.SetWindowText(str);else if(i9&i36)str.Format(%i,i);m_num41.SetWindowText(str);else if(i9&i36)str.Format(%i,i);m_num42.SetWindowText(str);else if(i9&i36)str.Format(%i,i);m_num43.SetWindowText(str);else if(i9&i36)str.Format(%i,i);m_nu

9、m44.SetWindowText(str);else if(i9&i36)str.Format(%i,i);m_num45.SetWindowText(str);else if(i9&i36)str.Format(%i,i);m_num46.SetWindowText(str);else if(i9&i36)str.Format(%i,i);m_num47.SetWindowText(str);else if(i9&i36)str.Format(%i,i);m_num48.SetWindowText(str);else if(i9&i36)str.Format(%i,i);m_num49.S

10、etWindowText(str);else if(i9&i36)str.Format(%i,i);m_num36.SetWindowText(str);else if(i9&i36)str.Format(%i,i);m_num37.SetWindowText(str);else if(i9&i36)str.Format(%i,i);m_num38.SetWindowText(str);else if(i9&i36)str.Format(%i,i);m_num39.SetWindowText(str);else if(i9&i36)str.Format(%i,i);m_num40.SetWin

11、dowText(str);else if(i9&i36)str.Format(%i,i);m_num41.SetWindowText(str);else if(i9&i36)str.Format(%i,i);m_num42.SetWindowText(str);else if(i9&i36)str.Format(%i,i);m_num43.SetWindowText(str);else if(i9&i36)str.Format(%i,i);m_num44.SetWindowText(str);else if(i9&i36)str.Format(%i,i);m_num45.SetWindowTe

12、xt(str);else if(i9&i36)str.Format(%i,i);m_num46.SetWindowText(str);else if(i9&i36)str.Format(%i,i);m_num47.SetWindowText(str);else if(i9&i36)str.Format(%i,i);m_num48.SetWindowText(str);else if(i9&i36)str.Format(%i,i);m_num49.SetWindowText(str);else if(i9&i36)str.Format(%i,i);m_num50.SetWindowText(st

13、r);else if(i9&i36)str.Format(%i,i);m_num51.SetWindowText(str);else if(i9&i36)str.Format(%i,i);m_num52.SetWindowText(str);else if(i9&i36)str.Format(%i,i);m_num53.SetWindowText(str);else if(i9&i36)str.Format(%i,i);m_num54.SetWindowText(str);else if(i9&i36)str.Format(%i,i);m_num55.SetWindowText(str);el

14、se if(i9&i36)str.Format(%i,i);m_num56.SetWindowText(str);else if(i9&i36)str.Format(%i,i);m_num36.SetWindowText(str);else if(i9&i36)str.Format(%i,i);m_num37.SetWindowText(str);else if(i9&i36)str.Format(%i,i);m_num38.SetWindowText(str);else if(i9&i36)str.Format(%i,i);m_num39.SetWindowText(str);else if

15、(i9&i36)str.Format(%i,i);m_num40.SetWindowText(str);else if(i9&i36)str.Format(%i,i);m_num41.SetWindowText(str);else if(i9&i36)str.Format(%i,i);m_num42.SetWindowText(str);else if(i9&i36)str.Format(%i,i);m_num43.SetWindowText(str);else if(i9&i36)str.Format(%i,i);m_num44.SetWindowText(str);else if(i9&i

16、36)str.Format(%i,i);m_num45.SetWindowText(str);else if(i9&i36)str.Format(%i,i);m_num46.SetWindowText(str);else if(i9&i36)str.Format(%i,i);m_num47.SetWindowText(str);else if(i9&i36)str.Format(%i,i);m_num48.SetWindowText(str);else if(i9&i36)str.Format(%i,i);m_num49.SetWindowText(str);else if(i9&i36)str.Format(%i,i);m_num50.SetWindowText(str);else if(i9&i36)str.Format(%i,i);m_num51.SetWindowText(str);else if(i9&i36)str.Format(%i,i);m_num52.SetWindowText(str);else if(i9&i36)str.Format(%i,i);m_num53.SetWindowText(str);else if(i10)str.Format(%i,i);m_num53.SetWindowText(0+str);break;case 19:i = r

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 建筑/施工/环境 > 项目建议


备案号:宁ICP备20000045号-2

经营许可证:宁B2-20210002

宁公网安备 64010402000987号