Skip to content

Client did not pay? Add Opacity to a Windows Form until it disappears completely! Inspired by https://github.com/kleampa/not-paid

Notifications You must be signed in to change notification settings

g-otn/winforms-not-paid

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Client did not pay?

Lower a Form's Opacity as the due date aproaches until it disappears completely!

This class library adds a extension method to a Windows.Forms.Form which lowers the Form.Opacity based on how close DateTime.Today is from a given DateTime due date. If DateTime.Today is past due date, the Form.Opacity is set to 0 and the Form.Controls is cleared.

Usage

  1. Add the WinformsNotPaid.dll to your project References.
  2. Import the class library in your Form .cs
using WinformsNotPaid;
  1. Inside the Form constructor, after InitializeComponent(), call the ChangeNotPaidOpacity method:
public Form1()
{
    InitializeComponent();
    this.ChangeNotPaidOpacity(DateTime.Parse("Aug 25, 2019"), 30);
}

ChangeNotPaidOpacity method

(couldn't think of a better name) It takes two parameters:

  • dueDate: A System.DateTime that marks the last day before the Opacity is set to 0 and all the controls are removed.
  • daysDeadline: A integer that says how many days before the dueDate should the Opacity start to lower.

Author

This was inspired and based of klempa's not-paid.

About

Client did not pay? Add Opacity to a Windows Form until it disappears completely! Inspired by https://github.com/kleampa/not-paid

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages