首页 | 互联网 | IT动态 | IT培训 | Cisco | Windows | Linux | Java | .Net | Oracle | 软件测试 | C/C++ | 嵌入式开发 | 存储世界 | 服务器
网络设备 | IDC | 安全 | 求职招聘 | 数字网校 | 网页设计 | 平面设计 | 技术专题 | 电子书下载 | 教学视频 | 源码下载 | 搜索 | 博客 | 论坛
中国IT实验室Dotnet频道
中国IT教育
Google
首页 ASP.NET  C#  XML/WebService ADO.NET VC.NET VB.NET .NET 资讯动态 专题 RSS订阅 讨论 下载
您现在的位置: 中国IT实验室 >> Dotnet >> C# >> 正文

用Visual C#编写屏幕保护程序

  private void InitializeComponent() file://初始化程序中使用到的组件

  {
   this.components = new System.ComponentModel.Container();
   System.Resources.ResourceManager resources = new   system.Resources.ResourceManger(typeof(screen));      
   this.word = new System.Windows.Forms.Label();
   this.timerSaver = new System.Windows.Forms.Timer(this.components);
   this.picture1 = new System.Windows.Forms.PictureBox();
   this.SuspendLayout();
   //
   // 设置文本显示控件(word)属性

   this.word.ForeColor = System.Drawing.Color.Yellow;
   this.word.Location = new System.Drawing.Point(624, 8);
   this.word.Name = "word";
   this.word.Size = new System.Drawing.Size(168, 16);
   this.word.TabIndex = 0;
   this.word.Visible = false;
   //
   // 设置计时器控件(timerSaver)属性

   this.timerSaver.Enabled = true;
   this.timerSaver.Interval = 5;
   this.timerSaver.Tick += new System.EventHandler(this.timerSaver_Tick);
   //
   // 设置图片控件(picture1)属性

   this.picture1.Image = ((System.Drawing.Bitmap)(resources.GetObject("picture1.Image")));
   this.picture1.Location = new System.Drawing.Point(800, 600);
   this.picture1.Name = "picture1";
   this.picture1.Size = new System.Drawing.Size(304, 224);
   this.picture1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
   this.picture1.TabIndex = 1;
   this.picture1.TabStop = false;
   //
   // 设置窗体(screen)属性

   this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
   this.BackColor = System.Drawing.Color.Black;
   this.ClientSize = new System.Drawing.Size(800, 600);
   this.ControlBox = false;
   this.Controls.AddRange(new System.Windows.Forms.Control[] {this.picture1,this.word});
   this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
   this.KeyPreview = true;
   this.MaximizeBox = false;
   this.MinimizeBox = false;
   this.Name = "screen";
   this.ShowInTaskbar = false;
   this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
   this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
   file://键盘按下响应事件

   this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.screen_KeyDown);
             file://鼠标按下响应事件
 
   this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.screen_MouseDown);
   file://窗体启动调用事件

   this.Load += new System.EventHandler(this.Form1_Load);
             file://鼠标移动响应事件

   this.MouseMove += new System.Windows.Forms.MouseEventHandler(this.screen_MouseMove);
   this.ResumeLayout(false);
  }

 

上一页  [1] [2] [3] [4] 下一页

【责编:Luzi】

中国IT教育

相关产品和培训
文章评论
 友情推荐链接
 认证培训
 专题推荐

 ·WEB程序开发--ASP.NET和PHP、JSP究竟学哪个?
 ·五步带你入门XML
 ·关于Java框架技术专题
 ·XML全攻略技术专题
 ·JAVA开源技术介绍专题
 ·Java嵌入式开发之J2ME技术专题
 ·超前体验 Oracle 11g的5个新特性…
 ·揭密使用VB.NET的五个实用技巧
 ·Oracle和SQL Server常用函数对比专题…
 ·展现C#世界 C#程序设计专题…
 今日更新
 社区讨论
 博客论点
 频道精选
 Dotnet频道相关导航