2022年C语言实现图形界面登陆窗口.pdf





《2022年C语言实现图形界面登陆窗口.pdf》由会员分享,可在线阅读,更多相关《2022年C语言实现图形界面登陆窗口.pdf(18页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、纯 C语言实现图形界面登陆窗口一下是界面图:编程工具是:请根据个人需要对源代码进行修改使用,图片放在工程文件夹中。 新建时应该将文件后缀设置为.cpp以下是程序灯源代码:#include#include精品资料 - - - 欢迎下载 - - - - - - - - - - - 欢迎下载 名师归纳 - - - - - - - - - -第 1 页,共 18 页 - - - - - - - - - - #include#include#include#include#define LEN_A 20/账户长度#define LEN_P 10/密码长度typedef struct Accountcha
2、r name20;long int password;InAccount;typedef struct inputAPwordInAccount account;int flag;精品资料 - - - 欢迎下载 - - - - - - - - - - - 欢迎下载 名师归纳 - - - - - - - - - -第 2 页,共 18 页 - - - - - - - - - - InputAPword;void inputbox(void);void cursor(void);void cursor2(void);void name(void);int MouseEvent(IMAGE);Inp
3、utAPword menu2(void)initgraph(640,480);/初始化图形界面IMAGE Img1;/ 声明一个 IMAGE 变量IMAGE Img2(640,480);/声明一个 IMAGE 变量char input1LEN_A;/用于接收输入的字符串char input2LEN_P;/用于接收输入的字符串int j;InputAPword account;精品资料 - - - 欢迎下载 - - - - - - - - - - - 欢迎下载 名师归纳 - - - - - - - - - -第 3 页,共 18 页 - - - - - - - - - - loadimage(&
4、Img1,_T();/加载图片SetWorkingImage(&Img1);/设置当前绘图设备为Img1setlinestyle(PS_SOLID, NULL, 2);/设置线的样式setfont(64,0,华文隶书 );/设置字体的样式和大小settextcolor(RGB(134,0,255);/设置字体的颜色setlinecolor(RGB(16,16,16);/设置线的颜色setbkmode(TRANSPARENT);/ 设置字体的背景为透明outtextxy(50,50,_T(A 用户登录 );/显示汉字settextcolor(RGB(0,0,0);/设置字体的颜色rectangl
5、e(50,150,350,340);/画矩形框rectangle(254,515,302,585);/画一个矩形框fillrectangle(100,280,173,315);/登录框fillrectangle(223,280,296,315);/取消框SetWorkingImage();/恢复当前绘图设备为默认设备putimage(0,0,&Img1);/显示图片精品资料 - - - 欢迎下载 - - - - - - - - - - - 欢迎下载 名师归纳 - - - - - - - - - -第 4 页,共 18 页 - - - - - - - - - - doname();/显示文字信息
6、setbkmode(OPAQUE);/设置字体背景为默认setbkcolor(RGB(255,255,255);cursor();/显示输入框以及闪烁的光标for(j=0;LEN_A;j+)/限制输入,最多允许输入LNE位数据input1j=getch();/读取键盘输入的字符并存入数组outtextxy(161+8*j,193,input1j);/将字符显示在图片上if(input1j=8)/按删除键时的操作input1j-1=0;/字符数组内容删除一位outtextxy(161+8*j,193, );/将字符遮掩outtextxy(161+8*(j-1),193, );/将字符遮掩j -=
7、2;/数组坐标后退两个if(j=-1)/当回退到头时的处理input10=0;/对数组进行标记精品资料 - - - 欢迎下载 - - - - - - - - - - - 欢迎下载 名师归纳 - - - - - - - - - -第 5 页,共 18 页 - - - - - - - - - - break;/退出本次输入continue;else if(input1j=13)/按回车键时的处理input1j=0;/将数组的最后一个数据标记为0if(j=0)/无任何输入,且按下回车时的处理outtextxy(161+8*j,193, );/将回车显示的字符遮掩outtextxy(161+8*(j-
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 2022 语言 实现 图形界面 登陆 窗口

限制150内