时钟代码用VB编写一个钟表的代码是?

时钟代码  时间:2021-05-29  阅读:()

vb 时钟代码

修改并测试成功!!!!!!!! Private?Sub?Form_Load() ?????Form1.AutoRedraw?=?True ?????Form1.Height?=?8000 ?????Form1.Width?=?8000 ?????Form1.Scale?(-100,?-100)-(100,?100) ?????Line1.X1?=?0:?Line1.Y1?=?0 ?????Line2.X2?=?0:?Line2.Y1?=?0‘......>>>Line2.X1?=?0:?Line2.Y1?=?0 ?????Line3.X1?=?0:?Line3.Y1?=?0 ?????Line1.BorderColor?=?RGB(0,?0,?0) ?????Line1.BorderWidth?=?3 ?????Line2.BorderColor?=?RGB(0,?0,?255) ?????Line2.BorderWidth?=?2 ?????Line3.BorderColor?=?RGB(255,?0,?0) ?????Line3.BorderWidth?=?1 ?????Shape1.Top?=?-95 ?????Shape1.Left?=?-95 ?????Shape1.Width?=?190 ?????Shape1.Height?=?190 ?????Shape1.BorderStyle?=?3 ?????Shape1.BorderWidth?=?3 ?????Shape1.BorderColor?=?RGB(0,?0,?255) ?????Timer1.Interval?=?1000 End?Sub Private?Sub?Timer1_Timer() ???sx?=?Sin((180?-?6?*?Second(Time))?*?3.14159?/?180)?*?65 ???sy?=?Cos((180?-?6?*?Second(Time))?*?3.14159?/?180)?*?65 ???Line3.X2?=?sx ???Line3.Y2?=?sy ???mx?=?Sin((180?-?6?*?Minute(Time))?*?3.14159?/?180)?*?65 ???my?=?Cos((180?-?6?*?Minute(Time))?*?3.14159?/?180)?*?65 ???Line2.X2?=?mx ???Line2.Y2?=?my ???hx?=?Sin((180?-?(30?*?Hour(Time)?+?30?*?Minute(Time)?/?60))?*?3.14159?/?180)?*?40 ???hy?=?Cos((180?-?(30?*?Hour(Time)?+?30?*?Minute(Time)?/?60))?*?3.14159?/?180)?*?40 ???Line1.X2?=?hx ???Line1.Y2?=?hy ???Form1.CurrentX?=?-2 ???Form1.CurrentY?=?80 ???Form1.Print?"6" ??? ???Form1.CurrentX?=?-2 ???Form1.CurrentY?=?-80 ???Form1.Print?"12" ??? ???Form1.CurrentX?=?75 ???Form1.CurrentY?=?-8 ???Form1.Print?"3" ??? ???Form1.CurrentX?=?-80 ???Form1.CurrentY?=?-8 ???Form1.Print?"9" End?Sub Scale用于标示对象的坐标系统,其中前一组数字表示Picture1的左上角的坐标值,后一组数字表示Picture1的右下角的坐标值。

因此如果你将左上角的坐标和右下角的坐标值设置为同一个坐标,则VB会认为你设置有误,会报“除数为零”的错误。

..........张志晨..............

在网上找到了一个电脑桌面的时钟代码 怎么用呀

桌面上使用有两种方式:

1、桌面-右健属性-web,把网上的swf的网址写入,

2、把这个时钟下载到本地,然后包装成exe文件,设置开机运行,并设置窗口在最上,就可以了。

可用flash的这个插件工具,具体下载和使用上网找资料:

C程序编写一个时钟的代码怎样写?

时钟源程序(C语言) #include<graphics.h> #include<math.h> #include<stdio.h> #include<dos.h> #define pi 3.1415926 #define X(a,b,c) x=a*cos(b*c*pi/180-pi/2)+300; #define Y(a,b,c) y=a*sin(b*c*pi/180-pi/2)+240; #define d(a,b,c) X(a,b,c);Y(a,b,c);line(300,240,x,y) void init() {int i,l,x1,x2,y1,y2; setbkcolor(3); outtextxy(224, 234, "9"); outtextxy(375,234,"3"); outtextxy(295,165,"12"); outtextxy(299,305,"6"); circle(300,240,100); circle(300,240,105); circle(300,240,5); for(i=0;i<60;i++) {if(i%5==0) l=15; else l=5; x1=100*cos(i*6*pi/180)+300; y1=100*sin(i*6*pi/180)+240; x2=(100-l)*cos(i*6*pi/180)+300; y2=(100-l)*sin(i*6*pi/180)+240; line(x1,y1,x2,y2); } } main() { int x,y,i; int gd=VGA,gm=2; unsigned char h,m,s; struct time t[1]; initgraph(&gd,&gm,"d:\tc"); init(); setwritemode(1); gettime(t); h=t[0].ti_hour; m=t[0].ti_min; s=t[0].ti_sec; setcolor(10); d(60,h,30); setcolor(14); d(80,m,6); setcolor(4); d(100,s,6); while(!kbhit()) {while(t[0].ti_sec==s) gettime(t); sound(400); delay(70); sound(200); delay(30); nosound(); setcolor(4); d(100,s,6); s=t[0].ti_sec; d(100,s,6); if (t[0].ti_min!=m) { setcolor(14); d(80,m,6); m=t[0].ti_min; d(80,m,6); } if (t[0].ti_hour!=h) { setcolor(7); d(60,h,30); h=t[0].ti_hour; d(60,h,30); sound(1000); delay(240); nosound(); delay(140); sound(2000); delay(240); nosound(); } } getch(); closegraph(); }

谁知道一些个性时钟的代码?告诉我几个,拜托!

有一个c 的: #include #include #include #define CENTERX 320 /*表盘中心位置*/ #define CENTERY 175 #define CLICK 100 /*喀嗒声频率*/ #define CLICKDELAY 30 /*喀嗒声延时*/ #define HEBEEP 10000 /*高声频率*/ #define LOWBEEP 500 /*低声频率*/ #define BEEPDELAY 200 /*报时声延时*/ /*表盘刻度形状*/ int Mrk_1[8]={-5,-160,5,-160,5,-130,-5,-130, }; int Mrk_2[8]={-5,-160,5,-160,2,-130,-2-130, }; /*时针形状*/ int HourHand[8]={-3,-100,3,-120,4, 10,-4,10}; /*分针形状*/ int MiHand[8]={-3,-120,3,-120,4, 10,-4,10}; /*秒针形状*/ int SecHand[8]={-2,-150,2,-150,3, 10,-3,10}; /*发出喀嗒声*/ void Click() { sound(CLICK); delay(CLICKDELAY); nosound(); } /*高声报时*/ void HighBeep() { sound(HEBEEP); delay(BEEPDELAY); nosound; } /*低声报时*/ void LowBeep() { sound(LOWBEEP); } /*按任意角度画多边形*/ void DrawPoly(int *data,int angle,int color) { int usedata[8]; float sinang,cosang; int i; sinang=sin((float)angle/180*3.14); cosang=cos((float)angle/180*3.14); for(i=0;i<8;i+=2) { usedata[i] =CENTERX+ cosang*data[i]-sinang*data[i+1]+.5; usedata[i+1]=CENTERY+sinang*data[i]+cosang*data[i+1]+.5; } setfillstyle(SOLID_FILL,color); fillpoly(4,usedata); } /*画表盘*/ void DrawClock(struct time *cutime) { int ang; float hourrate,minrate,secrate; setbkcolor(BLUE); cleardevice(); setcolor(WHITE); /* 画刻度*/ for(ang=0;ang<360;ang+=90) { DrawPoly(Mrk_1,ang,WHITE); DrawPoly(Mrk_2,ang+30,WHITE); DrawPoly(Mrk_2,ang+60,WHITE); } secrate=(float)cutime->ti_sec/60; minrate=((float)cutime->ti_min+secrate)/60; hourrate=(((float)cutime->ti_hour/12)+minrate)/12; ang=hourrate*360; DrawPoly(HourHand,ang,YELLOW);/*画时针*/ ang=minrate*360; DrawPoly(MiHand,ang, GREEN);/*画分针*/ ang=secrate*360; DrawPoly(SecHand,ang, RED);/*画秒针*/ } main() { int gdriver=EGA, gmode=EGAHI; int curpage; struct time curtime ,newtime ; initgraph(&gdriver,&gmode,"c:\tc"); setbkcolor(BLUE); cleardevice(); gettime(&curtime); curpage=0; DrawClock(&curtime); while(1) { if(kbhit()) break; /*按任意键退出*/ gettime(&newtime); /*检测系统时间*/ if(newtime.ti_sec!=curtime.ti_sec)/*每1秒更新一次时间*/ { if(curpage==0) curpage=1; else curpage=0; curtime=newtime; /*设置绘图页*/ setactivepage(curpage); /*在图页上画表盘*/ DrawClock(&curtime); /*设置绘图页为当前可见页*/ isualpage(curpage); /*0分0秒高声报时*/ if(newtime.ti_min==0&&newtime.ti_sec==0) HighBeep(); /* 59分55至秒时低声报时*/ else if(newtime.ti_min==59&& newtime.ti_sec<=59) LowBeep();/*其他时间只发出喀嗒声*/ else Click(); } } closegraph(); }

谁有时钟的源代码?

#include<math.h> #include<dos.h> #include<graphics.h> #define CENTERX 320 #define CENTERY 175 #define CLICK 100 #define CLICKDELAY 30 #define HEBEEP 10000 #define LOWBEEP 500 #define BEEPDELAY 200 int Mrk_1[8]={-5,-160,5,-160,5,-130,-5,-130, }; int Mrk_2[8]={-5,-160,5,-160,2,-130,-2-130, }; int HourHand[8]={-3,-100,3,-120,4, 10,-4,10}; int MiHand[8]={-3,-120,3,-120,4, 10,-4,10}; int SecHand[8]={-2,-150,2,-150,3, 10,-3,10}; void Click() { sound(CLICK); delay(CLICKDELAY); nosound(); } void HighBeep() { sound(HEBEEP); delay(BEEPDELAY); nosound; } void LowBeep() { sound(LOWBEEP); } void DrawPoly(int *data,int angle,int color) { int usedata[8]; float sinang,cosang; int i; sinang=sin((float)angle/180*3.14); cosang=cos((float)angle/180*3.14); for(i=0;i<8;i+=2) { usedata[i] =CENTERX+ cosang*data[i]-sinang*data[i+1]+.5; usedata[i+1]=CENTERY+sinang*data[i]+cosang*data[i+1]+.5; } setfillstyle(SOLID_FILL,color); fillpoly(4,usedata); } void DrawClock(struct time *cutime) { int ang; float hourrate,minrate,secrate; setbkcolor(BLACK); cleardevice(); setcolor(WHITE); for(ang=0;ang<360;ang+=90) { DrawPoly(Mrk_1,ang,WHITE); DrawPoly(Mrk_2,ang+30,WHITE); DrawPoly(Mrk_2,ang+60,WHITE); } secrate=(float)cutime->ti_sec/60; minrate=((float)cutime->ti_min+secrate)/60; hourrate=(((float)cutime->ti_hour/12)+minrate)/12; ang=hourrate*360; DrawPoly(HourHand,ang,YELLOW); ang=minrate*360; DrawPoly(MiHand,ang, GREEN); ang=secrate*360; DrawPoly(SecHand,ang, RED); } main() { int gdriver=EGA, gmode=EGAHI; int curpage; struct time curtime ,newtime ; initgraph(&gdriver,&gmode,"c:\tc"); setbkcolor(BLUE); cleardevice(); gettime(&curtime); curpage=0; DrawClock(&curtime); while(1) { if(kbhit()) break; gettime(&newtime); if(newtime.ti_sec!=curtime.ti_sec) { if(curpage==0) curpage=1; else curpage=0; curtime=newtime; setactivepage(curpage); DrawClock(&curtime); isualpage(curpage); if(newtime.ti_min==0&&newtime.ti_sec==0) HighBeep(); else if(newtime.ti_min==59&& newtime.ti_sec<=59) LowBeep(); else Click(); } } closegraph(); } 此代码有声音

用VB编写一个钟表的代码是?

Private Sub Command1_Click() End Sub Private Sub Check1_Click() If Check1.Value = 0 Then Timer1.Enabled = False Check1.Caption = "钟表已停" Else Timer1.Enabled = True Check1.Caption = "钟表正在走动" End If End Sub Private Sub Check2_Click() If Check2.Value = 0 Then Label1.Visible = False Check2.Caption = "钟表已关闭" Else Label1.Visible = True Check2.Caption = "钟表已打开" End If End Sub Private Sub Form_Load() Label1.Caption = Time End Sub Private Sub HScroll1_Change() Label1.ForeColor = RGB(Int(HScroll3.Value), Int(HScroll2.Value), Int(HScroll1.Value)) End Sub Private Sub HScroll2_Change() Label1.ForeColor = RGB(Int(HScroll3.Value), Int(HScroll2.Value), Int(HScroll1.Value)) End Sub Private Sub HScroll3_Change() Label1.ForeColor = RGB(Int(HScroll3.Value), Int(HScroll2.Value), Int(HScroll1.Value)) End Sub Private Sub Timer1_Timer() Label1.Caption = Time End Sub Private Sub Timer2_Timer() Dim i, j, k As Integer i = Int(Rnd() * 225 + 1) + 0 j = Int(Rnd() * 225 + 1) + 0 k = Int(Rnd() * 225 + 1) + 0 Label1.BackColor = RGB(i, j, k) End Sub

妮妮云(43元/月 ) 香港 8核8G 43元/月 美国 8核8G

妮妮云的来历妮妮云是 789 陈总 张总 三方共同投资建立的网站 本着“良心 便宜 稳定”的初衷 为小白用户避免被坑妮妮云的市场定位妮妮云主要代理市场稳定速度的云服务器产品,避免新手购买云服务器的时候众多商家不知道如何选择,妮妮云就帮你选择好了产品,无需承担购买风险,不用担心出现被跑路 被诈骗的情况。妮妮云的售后保证妮妮云退款 通过于合作商的友好协商,云服务器提供2天内全额退款,超过2天不退款 物...

触摸云 26元/月 ,美国200G高防云服务器

触摸云触摸云(cmzi.com),国人商家,有IDC/ISP正规资质,主营香港线路VPS、物理机等产品。本次为大家带上的是美国高防2区的套餐。去程普通线路,回程cn2 gia,均衡防御速度与防御,防御值为200G,无视UDP攻击,可选择性是否开启CC防御策略,超过峰值黑洞1-2小时。最低套餐20M起,多数套餐为50M,适合有防御型建站需求使用。美国高防2区 弹性云[大宽带]· 配置:1-16核· ...

PQ.hosting:香港HE/乌克兰/俄罗斯/荷兰/摩尔多瓦/德国/斯洛伐克/捷克vps,2核/2GB内存/30GB NVMe空间,€3/月

PQ.hosting怎么样?PQ.hosting是一家俄罗斯商家,正规公司,主要提供KVM VPS和独立服务器,VPS数据中心有香港HE、俄罗斯莫斯科DataPro、乌克兰VOLIA、拉脱维亚、荷兰Serverius、摩尔多瓦Alexhost、德国等。部分配置有变化,同时开通Paypal付款。香港、乌克兰、德国、斯洛伐克、捷克等为NVMe硬盘。香港为HE线路,三网绕美(不太建议香港)。免费支持wi...

时钟代码为你推荐
49美金美亚满49美元免运费还要收国内运费吗?刚让人代拍了美亚的几十美元东带宽租用300M网站空间的租用每月需要花费多少钱?带宽怎么样?不要那种慢如蜗牛的服务器,请提供参考,谢谢!怎么登录阿里云服务器mac系统怎么连接阿里云服务器?学生腾讯云3d胆码什么意思中国电信112测速中国电信 上行速度 最高几M?虚拟主机安全吗VMware虚拟机和主机相连后,主机安全吗?服务器硬防专家你好,我想租一个免备案+硬防的服务器。硬防大概要30G左右 有便宜又好用的推荐吗?谢谢拉服务器硬防263邮件服务器硬防千兆到底是什么概念?施乐700施乐700代码010-342求高手指点腾讯云是什么(互联网)什么是“云”、和腾讯云 希望能介绍的简单易懂
免费域名跳转 a5域名交易 服务器配置技术网 美国主机评测 256m内存 z.com 国内php空间 镇江联通宽带 华为网络硬盘 河南移动邮件系统 183是联通还是移动 国外代理服务器软件 什么是服务器托管 息壤代理 无限流量 lamp怎么读 xshell5注册码 accountsuspended register.com windowsserver2008r2 更多