惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Recorded Future
Recorded Future
人人都是产品经理
人人都是产品经理
Google DeepMind News
Google DeepMind News
Google DeepMind News
Google DeepMind News
雷峰网
雷峰网
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
S
Secure Thoughts
酷 壳 – CoolShell
酷 壳 – CoolShell
SecWiki News
SecWiki News
W
WeLiveSecurity
N
News | PayPal Newsroom
AI
AI
The Last Watchdog
The Last Watchdog
I
InfoQ
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
B
Blog RSS Feed
Hacker News: Ask HN
Hacker News: Ask HN
Hugging Face - Blog
Hugging Face - Blog
L
LINUX DO - 最新话题
Engineering at Meta
Engineering at Meta
Hacker News - Newest:
Hacker News - Newest: "LLM"
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
www.infosecurity-magazine.com
www.infosecurity-magazine.com
腾讯CDC
Attack and Defense Labs
Attack and Defense Labs
博客园 - Franky
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Apple Machine Learning Research
Apple Machine Learning Research
Stack Overflow Blog
Stack Overflow Blog
Forbes - Security
Forbes - Security
Martin Fowler
Martin Fowler
D
Docker
Last Week in AI
Last Week in AI
H
Hackread – Cybersecurity News, Data Breaches, AI and More
D
Darknet – Hacking Tools, Hacker News & Cyber Security
P
Privacy & Cybersecurity Law Blog
U
Unit 42
H
Help Net Security
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
S
Schneier on Security
博客园 - 司徒正美
S
SegmentFault 最新的问题
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Schneier on Security
Schneier on Security
P
Palo Alto Networks Blog
Jina AI
Jina AI
V
Vulnerabilities – Threatpost
P
Proofpoint News Feed
大猫的无限游戏
大猫的无限游戏
WordPress大学
WordPress大学

博客园 - semye

input+select(multiple)实现下拉框输入值 简单的js分页脚本 - semye - 博客园 请问做个类似这样的网站多少钱 省份和城市 - semye - 博客园 客户端取用户控件中服务器控件的标识 VS2003调试很慢 enctype="multipart/form-data" 群发邮件太慢了! SQL SERVER “数组参数” WEB水晶报表部署笔记 写程序解智力题,help!!! 低级错误是怎样“炼”成的? SQL语句区分大小写问题 发送邮件 - semye - 博客园 JS事件大全 WinForm动态添加控件及其事件 公历转换为农历 简单水晶报表程序与安装部署文件制作 导数程序
WinForm程序实现滚动字幕与背景音乐
semye · 2007-04-03 · via 博客园 - semye

1.滚动字幕
用一个LABEL放在PANEL中,用一个TIMER来动态改变LABEL的LOCATION

 1            int xx = this.label1.Location.X;
 2            int yy = this.label1.Location.Y;
 3        private void timer1_Tick(object sender, System.EventArgs e)
 4        {
 5            if(this.label1.Location.Y+this.label1.Size.Height>0)
 6            {
 7                this.label1.Location = new System.Drawing.Point(this.label1.Location.X,this.label1.Location.Y-1);
 8            }

 9            else
10            {
11                this.label1.Location = new System.Drawing.Point(xx,yy);
12            }

13        }

14

2.背景音乐

1        private void StartPlayMusic()
2        {
3            Music.PlayMusic("\".\\music\\菊花台.mp3\"");
4        }

5

Music.cs

 1using   System;   
 2using   System.Runtime.InteropServices;   
 3    
 4namespace   TestWinProj 
 5{   
 6    internal   class   Music   
 7    {   
 8        [DllImport("winmm.dll")] 
 9        public static extern long PlaySound(String fileName,long a,long b);
10
11        [DllImport("winmm.dll")]
12        public static extern long mciSendString(string lpstrCommand,string lpstrReturnString,long length,long hwndcallback);
13        
14        /// <summary>
15        /// 播放音乐文件
16        /// </summary>
17        /// <param name="p_FileName">音乐文件名称</param>

18        public static void PlayMusic(string p_FileName)
19        {
20            try
21            {
22                mciSendString(@"close " +p_FileName ,"                                  ",0,0);
23                mciSendString(@"open " + p_FileName,"                                  ",0,0);
24                mciSendString(@"play " + p_FileName ,"                                  ",0,0);
25            }

26            catch
27            {
28            }

29        }

30        
31        /// <summary>
32        /// 停止当前音乐播放
33        /// </summary>
34        /// <param name="p_FileName">音乐文件名称</param>

35        public static void StopMusic(string p_FileName)
36        {
37            try
38            {
39                mciSendString(@"close " + p_FileName,"                                  ",0,0);
40            }

41            catch{}
42        }

43
44
45    }
   
46}
   
47
48