Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/g-otn/winforms-not-paid
Client did not pay? Add Opacity to a Windows Form until it disappears completely! Inspired by https://github.com/kleampa/not-paid
https://github.com/g-otn/winforms-not-paid
csharp-library joke windows-forms
Last synced: 13 days ago
JSON representation
Client did not pay? Add Opacity to a Windows Form until it disappears completely! Inspired by https://github.com/kleampa/not-paid
- Host: GitHub
- URL: https://github.com/g-otn/winforms-not-paid
- Owner: g-otn
- Created: 2019-08-03T04:41:19.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-08-04T23:06:32.000Z (over 5 years ago)
- Last Synced: 2024-10-31T07:51:30.026Z (20 days ago)
- Topics: csharp-library, joke, windows-forms
- Language: C#
- Homepage:
- Size: 14.6 KB
- Stars: 44
- Watchers: 2
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## 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``](https://github.com/g-otn/winforms-not-paid/releases) to your project References.
2. Import the class library in your Form ``.cs``
```csharp
using WinformsNotPaid;
```
3. Inside the Form constructor, after ``InitializeComponent()``, call the ``ChangeNotPaidOpacity`` method:
```csharp
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](https://github.com/kleampa)'s [not-paid](https://github.com/kleampa/not-paid).