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

推荐订阅源

I
InfoQ
C
CERT Recently Published Vulnerability Notes
The Last Watchdog
The Last Watchdog
P
Proofpoint News Feed
D
Darknet – Hacking Tools, Hacker News & Cyber Security
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
GbyAI
GbyAI
T
Tenable Blog
博客园 - 三生石上(FineUI控件)
P
Privacy & Cybersecurity Law Blog
Simon Willison's Weblog
Simon Willison's Weblog
Jina AI
Jina AI
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
T
Tor Project blog
博客园_首页
F
Fortinet All Blogs
博客园 - Franky
Latest news
Latest news
Last Week in AI
Last Week in AI
T
Threat Research - Cisco Blogs
Scott Helme
Scott Helme
L
LINUX DO - 热门话题
U
Unit 42
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Hugging Face - Blog
Hugging Face - Blog
D
Docker
Project Zero
Project Zero
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
MongoDB | Blog
MongoDB | Blog
F
Full Disclosure
D
DataBreaches.Net
Google DeepMind News
Google DeepMind News
Cisco Talos Blog
Cisco Talos Blog
Y
Y Combinator Blog
WordPress大学
WordPress大学
C
Cyber Attacks, Cyber Crime and Cyber Security
H
Help Net Security
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
月光博客
月光博客
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Blog — PlanetScale
Blog — PlanetScale
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
S
Schneier on Security
C
Cybersecurity and Infrastructure Security Agency CISA
P
Proofpoint News Feed
PCI Perspectives
PCI Perspectives
Cloudbric
Cloudbric
V
Visual Studio Blog
Recorded Future
Recorded Future
人人都是产品经理
人人都是产品经理

博客园 - 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