|
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace FadeForm
{
public partial class FadeFormDemo : FadeForm
{
public FadeFormDemo()
{
InitializeComponent();
numericUpDownMinimizedOpacity.Value = (decimal)this.MinimizedOpacity;
numericUpDownActiveOpacity.Value = (decimal)this.ActiveOpacity;
numericUpDownInactiveOpacity.Value = (decimal)this.InactiveOpacity;
numericUpDownTargetOpacity.Value = (decimal)this.TargetOpacity;
numericUpDownFadeTime.Value = (decimal)this.FadeTime;
timer1.Start();
}
[STAThread]
static void Main()
{
Application.Run(new FadeFormDemo());
}
private void numericUpDownMinimizedOpacity_ValueChanged(object sender, EventArgs e)
{
this.MinimizedOpacity = (double)numericUpDownMinimizedOpacity.Value;
}
private void numericUpDownActiveOpacity_ValueChanged(object sender, EventArgs e)
{
this.ActiveOpacity = (double)numericUpDownActiveOpacity.Value;
}
private void numericUpDownInactiveOpacity_ValueChanged(object sender, EventArgs e)
{
this.InactiveOpacity = (double)numericUpDownInactiveOpacity.Value;
}
private void numericUpDownFadeTime_ValueChanged(object sender, EventArgs e)
{
this.FadeTime = (double)numericUpDownFadeTime.Value;
}
private void buttonTargetOpacity_Click(object sender, EventArgs e)
{
this.TargetOpacity = (double)numericUpDownTargetOpacity.Value;
}
private void timer1_Tick(object sender, EventArgs e)
{
if(!numericUpDownTargetOpacity.Focused&&!buttonTargetOpacity.Focused)numericUpDownTargetOpacity.Value=(decimal)this.TargetOpacity;
}
private void FadeFormDemo_Activated(object sender, EventArgs e)
{
numericUpDownMinimizedOpacity.Focus();
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
I am a mechanical engineer that works as a high school math teacher in Mulberry, Arkansas. I use programming as one way to keep my mind sharp.