/* Program : A Simple Screen Saver
* File Name : ScreenSaver
* Author : Tran Khanh Hien
* Date :
* email :
*/
namespace Screen_Saver
{
using System;
using System
using System
using System
using System
using System
/// <summary>
/// Summary description for Form
/// </summary>
public class ScreenSaver : System
{
/// <summary>
/// Required designer variable
/// </summary>
private System
private System
private System
private int iSpeed =
private string strMarqueeText=
private System
System
private Color colorMarquee = System
private int iDistance;
private int ixStart=
private int iyStart=
public ScreenSaver()
{
InitializeComponent();
lblMarquee
lblMarquee
System
}
/// <summary>
/// Clean up any resources being used
/// </summary>
public override void Dispose()
{
base
components
}
/// <summary>
/// Required method for Designer support
/// the contents of this method with the code editor
/// </summary>
private void InitializeComponent()
{
System
(ScreenSaver));
ponents = new System
this
this
//@this
//@this
//@this
//@timerSaver
timerSaver
timerSaver
timerSaver
lblMarquee
lblMarquee
lblMarquee
lblMarquee
lblMarquee
this
this
this
this
this
this
this
this
this
this
this
this
this
this
this
this
}
protected void timerSaver_Tick (object sender
{
lblMarquee
lblMarquee
lblMarquee
PlayScreenSaver();
}
private void PlayScreenSaver()
{
//Get the working area of the the computer screen
System
lblMarquee
lblMarquee
//Make the label visible if it is not currently visible
lblMarquee
// Increment the label distance based on the speed set by the user
iDistance += iSpeed;
// If the label is offscreen
if (lblMarquee
{
//Reset the distance to
iDistance =
//If the label is at the top
if (lblMarquee
lblMarquee
(ssWorkArea
// If label is in the middle of the screen move it to the bottom
else if(lblMarquee
lblMarquee
lblMarquee
//Move the label back to the top
else
lblMarquee
}
}
protected void Form
{
StopScreenSaver();
}
protected void Form
{
// Determine if the mouse cursor position has been stored previously
if (ixStart ==
{
//Store the mouse cursor coordinates
ixStart = e
iyStart = e
return;
}
// Has the mouse cursor moved since the screen saver was started?
else if (e
StopScreenSaver();
}
private void StopScreenSaver()
{
System
timerSaver
Application
}
protected void Form
{
StopScreenSaver();
}
/// <summary>
/// The main entry point for the application
/// </summary>
public static void Main(string[] args)
{
if (args
{
//Display the options dialog box
if (args[
{
MessageBox
MessageBox
Application
}
//Start the screen saver normally
else if (args[
Application
//Diaplay the password dialog
else if (args[
{
MessageBox
MessageBox
Application
}
}
//For any other args
else
Application
}
}
}
From:http://tw.wingwit.com/Article/program/net/201311/13725.html