Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

Sticky Pad : A Microsoft-Outlook Style Notepad using C#

0.00/5 (No votes)
11 Oct 2007 1  
This is a small Notepad application of Microsoft-Outlook using C#
Screenshot - stm.jpg

Introduction

This is a different kind of Notepad in Microsoft-Outlook Style. You can access this from anywhere. Using this, you can always make your important notes in front of you.

Screenshot - StickyPad2.jpg

Use of Stick Pad is very simple. Just open the application, and write anything you want!!!

How To Use?

Just open one stick pad, you can write your notes, create any number of notes using it:

Screenshot - StickyPad1.jpg

Menus: Just right click on the icon. The following menu should come up:

  • New: It should create a new Sticky Pad [You can create a new sticky pad by Double clicking on the icon too.]
  • Always on Top: If it is checked, then your Sticky Pad should be on top of any application.
  • Minimize: If you want to minimize, then just click on it.
  • Color: You can select 4 different types of Sticky Pad colors.
  • Close: It should close your sticky pad.

You will be able to move your pad - just drag the title bar. You can close it using click on the close icon.

Screenshot - StickyPad3.jpg

Using the Code

The code for Stick pad is very simple:

//
// Sticky Pad V 1.0
// Author : Abhijit Jana
// Language : C#
// Code From Move the Form by dragging the label
public const int WM_NCLBUTTONDOWN = 0xA1;
public const int HT_CAPTION = 0x2;
[DllImportAttribute("user32.dll")]
public static extern int SendMessage(IntPtr hWnd,
int Msg, int wParam, int lParam);
[DllImportAttribute("user32.dll")]
public static extern bool ReleaseCapture();

// This will Move the form 
private void label1_MouseMove(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
ReleaseCapture();
SendMessage(Handle, WM_NCLBUTTONDOWN, HT_CAPTION, 0);
}
}

// Will create a new form on double click 
private void pictureBox2_MouseDoubleClick(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
string _FilePath = Application.ExecutablePath.ToString();
System.Diagnostics.Process.Start(_FilePath); ;
}
}

//
// Color Settings
//
#region ColorSettings 
private void redToolStripMenuItem_Click(object sender, EventArgs e)
{
this.textBox1.BackColor = System.Drawing.Color.FromArgb
	(((int)(((byte)(255)))), ((int)(((byte)(192)))), ((int)(((byte)(192)))));
this.BackColor = System.Drawing.Color.FromArgb
	(((int)(((byte)(255)))), ((int)(((byte)(192)))), ((int)(((byte)(192)))));
}
private void yellowToolStripMenuItem_Click(object sender, EventArgs e)
{
this.textBox1.BackColor=System.Drawing.Color.FromArgb
	(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
this.BackColor = System.Drawing.Color.FromArgb
	(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
}

private void greenToolStripMenuItem_Click(object sender, EventArgs e)
{
this.textBox1.BackColor = System.Drawing.Color.FromArgb
	(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
this.BackColor = System.Drawing.Color.FromArgb
	(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
}

private void blueToolStripMenuItem_Click(object sender, EventArgs e)
{
this.textBox1.BackColor = System.Drawing.Color.FromArgb
	(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255)))));
this.BackColor = System.Drawing.Color.FromArgb
	(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255)))));
}
#endregion

//This will place your Pad on Top
private void alwaysOnTopToolStripMenuItem_Click(object sender, EventArgs e)
{
if (this.alwaysOnTopToolStripMenuItem.Checked == true)
{
this.TopMost = false ;
this.alwaysOnTopToolStripMenuItem.Checked = false;
}
else
{
this.TopMost = true;
this.alwaysOnTopToolStripMenuItem.Checked = true;
}
}

Future Implementation

Sticky pad will be available with a New section of Right Click menu [as given in the figure]. Whenever we click on it, a new pad will open for us. We can save it, or during closing if the content is not null, it will automatically save with a special icon. We can open the same notes only with the Stick pad.

It will look like this and should be in next version of Sticky Pad:

Screenshot - StickyPadF1.jpg

History

  • 11th October, 2007: Initial post

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here