c#之滚动字幕动画窗体的实现详解
时间:2022-02-14 08:46:19
提示:运行该程序可双击滚动字幕推出程序。(当然任务管理器也可以...)
步骤如下:
1.新建窗体,并设置窗体的FormBorderStyle属性为None,且“TransparencyKey”属性为“Control”。
2.使用1个Label空间,Text任意写,Font等样式自定。
3.使用1个Timer空间,设置其Enable为True,Interval设置为100;
4.添加Form1的窗体加载事件,代码如下:
private void Form1_Load(object sender, EventArgs e)
{
this.timer1.Interval = 10;
this.timer1.Enabled = true;
this.WindowState = FormWindowState.Maximized;
}
5.添加Timer1空间的Tick事件代码:
private void timer1_Tick(object sender, EventArgs e)
{
label1.Left -= 2;
if (label1.Right < 0)
label1.Left = this.Width;
}
6.给标签单击事件添加关闭窗口功能:
private void label1_Click(object sender, EventArgs e)
{
this.Close();
}
标签:c#,滚动字幕动画窗体
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
C#双缓冲技术实例详解
2023-02-02 15:56:37
java数据结构基础:稀疏数组
2021-12-18 19:01:17
![](https://img.aspxhome.com/file/2023/0/90990_0s.png)
Java 详解包装类Integer与int有哪些共通和不同
2022-06-15 20:12:18
Spring Security权限管理实现接口动态权限控制
2022-07-03 12:25:53
![](https://img.aspxhome.com/file/2023/5/83445_0s.png)
log4j配置失效日志中打印Debug信息问题
2022-10-12 10:13:12
![](https://img.aspxhome.com/file/2023/7/100667_0s.png)
快速排序算法在Java中的实现
2022-05-25 01:06:15
![](https://img.aspxhome.com/file/2023/7/69317_0s.png)
MyBatis超详细讲解如何实现分页功能
2023-08-22 23:06:51
![](https://img.aspxhome.com/file/2023/6/58216_0s.png)
springboot通过注解、接口创建定时任务详解
2021-06-05 06:00:29
![](https://img.aspxhome.com/file/2023/7/94187_0s.png)
java编程基础之模仿用户登录代码分享
2022-06-09 17:38:22
java实现在性能测试中进行业务验证实例
2022-10-15 09:50:11
Android开发必知 九种对话框的实现方法
2022-10-23 07:47:26
![](https://img.aspxhome.com/file/2023/2/93282_0s.jpg)
SpringBoot集成ElasticSearch的示例代码
2023-05-02 05:50:28
Java Servlet简单实例分享(文件上传下载demo)
2022-03-03 06:35:04
实例讲解Java的Spring框架中的控制反转和依赖注入
2023-04-24 17:44:49
![](https://img.aspxhome.com/file/2023/8/76228_0s.jpg)
Spring Boot CLI使用教程
2023-03-30 03:37:02
Android Service详解及示例代码
2021-12-24 05:44:17
![](https://img.aspxhome.com/file/2023/7/88667_0s.jpg)
Unity shader实现自由放大缩小效果
2022-04-05 06:50:46
![](https://img.aspxhome.com/file/2023/4/77224_0s.gif)
关于@Autowired注解和静态方法及new的关系
2021-07-16 13:08:06
C#基于Socket实现多人聊天功能
2021-12-06 12:00:47
![](https://img.aspxhome.com/file/2023/9/104359_0s.jpg)
详解Java七大阻塞队列之SynchronousQueue
2023-12-16 04:21:30
![](https://img.aspxhome.com/file/2023/3/93143_0s.jpg)