HypernovaDesktop Components · docs
Binarymission
WinForms › Post It Note

Post It Note

.NET Framework 4.8.NET 6 / 8 / 10v3.0.0WinForms

A sticky note for the desktop: a small, borderless, always-on-top window with a coloured title bar, a text area the user can type in, and a status bar – for reminders, comments on a record, or notes beside a document.

3public types
54public members
1namespaces

Assembly

AssemblyBinarymission.WinForms.Controls.PostItNote.dll
Root namespaceBinarymission.WinForms.Controls.Containers
Target frameworks.NET Framework 4.8, .NET 6 / 8 / 10

Overview

A note is a Form of its own. Create it in code with the window it belongs to, set its text and look, and call Form.Show. It has no parameterless constructor, so it is not dropped on a designer surface.

The parts of a note

Behaviour

The close icon does not close the note: it raises PostItNoteCloseRequested, and your handler decides – confirm, then call Form.Close. While FollowsParentWindow is on, the note hides when its window is minimised or hidden and comes back with it. InactiveOpacity fades notes that are not being worked in.

Appearance

NoteTheme sets the background and both title bars' colours in one go; set it first, then adjust single colours. A new note starts with sample text in the text area and status bar – replace both.

Getting started

A reminder note beside a customer record, removed when the user confirms its close icon.

using System;
using System.Drawing;
using System.Windows.Forms;
using Binarymission.WinForms.Controls.Containers;

private void OnAddNoteClick(object sender, EventArgs e)
{
    PostItNote note = new PostItNote(this)
    {
        NoteTheme = PostItNoteTheme.Blue,
        Pin = PostItNotePin.Red,
        NoteText = "Call back about the overdue invoice INV-20431.",
        StatusbarText = "Added " + DateTime.Now.ToString("d MMM, HH:mm"),
        TitlebarTooltip = "Drag to move",
        InactiveOpacity = 0.85,
        Size = new Size(240, 200),
        StartPosition = FormStartPosition.Manual,
        Location = new Point(Right - 260, Top + 80)
    };

    note.PostItNoteCloseRequested += (s, args) =>
    {
        if (MessageBox.Show(note, "Remove this note?", "Notes", MessageBoxButtons.YesNo) == DialogResult.Yes)
        {
            note.Close();
        }
    };

    note.Show(this);
}

API reference

Binarymission.WinForms.Controls.Containers

class PostItNoteA sticky note for the desktop: a small, borderless, always-on-top window with a coloured title bar, a text area the user can type in, and a status bar - for reminders, comments on a record, or notes beside a document.
enum PostItNotePinSpecifies the coloured pin a PostItNote shows in the middle of its built-in title bar.
enum PostItNoteThemeSpecifies the colour scheme of a PostItNote: its background and both title bars.