C#制作屏保

本文档介绍了如何使用C#编程制作屏幕保护程序,包括理解控件如timer、button等,以及详细步骤来将窗体转化为圆形,并提供了气泡运行路径的代码实现。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

** 屏幕保护是生活中常见的,这一章我们将学习屏幕保护。
学习之前我们得了解控件

一:控件

1):timer 时间控件
2):button 用户单击时 引发事件
3):listbox 可以从中选择项的列表
4):groupbpx 在一组空间周围显示一个带有可选标题的框架
5)label:为控件提供运行时信息或说明性文字
6):linkabel:Descriptionlinklabel
7):listview:以五种不同试图中的一种显示项的集合
8)menustrip:显示按功能分组的应用程序命令和选项。
等等。。。。
**现在了解下怎样把方形窗体变成圆形

二:画圆

 GraphicsPath path = new GraphicsPath();//画圆第一步
            path.AddEllipse(0, 0, 200, 200);//画圆第二步
            this.Region = new Region(path);//画圆第三步

画圆前提是给GraphicsPath进行实例化,因为工具箱中没有此类工具,需要手动工具。

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

using System.Drawing.Drawing2D;就是实例化的东西。

气泡代码

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Drawing.Drawing2D
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值