This is a Sticky note application using C# Windows Forms.
Steps:
1. Add a form in your application and make the form border style none. Set transparency key property as form background color so it will make your form transparent.
For viewing image for step1 see my article how to make screen saver.
2. Add a ContexMenuStrip, Timer control and add other controls as shown in the figure.

3. Code Behind.
/*
* When you run this application a directory named note and a text file named note.txt will generate in the C:\Program Files
*/
//this is the exit menu of the contexmenustrip
private void exitToolStripMenuItem_Click(object sender, EventArgs e)
{
this.Close();
}
//this is the Font menu of the contexmenustrip
private void fontToolStripMenuItem_Click(object sender, EventArgs e)
{
FontDialog font = new FontDialog();
if (font.ShowDialog() == DialogResult.OK)
{
txt_note.Font = font.Font;
}
}
//this is the FontColor menu of the contexmenustrip
private void fontColorToolStripMenuItem_Click(object sender, EventArgs e)
{
ColorDialog color = new ColorDialog();
if (color.ShowDialog() == DialogResult.OK)
{
txt_note.ForeColor = color.Color;
}
}
StreamWriter sw;
StreamReader sr;
FileStream note;
private void Form_note_Load(object sender, EventArgs e)
{
lbl_date.Text = System.DateTime.Now.ToLocalTime().ToString("dd/MM/yyyy hh:mm:ss");
//Time is enable in the form load even
timer1.Start();
createFile();
readNote();
}
/*
* creaFile() function is called in the Form load event
* It generate the directory ann file as mention above.
*/
private void createFile()
{
bool existDir = Directory.Exists(@"C:\Program Files\Note");
bool exitFolder = File.Exists(@"C:\Program Files\Note\note.txt");
//If directory and text file is generated then it will not generate again when you run application next time.
if (!(existDir && exitFolder))
{
Directory.CreateDirectory(@"C:\Program Files\Note");
note = File.Create(@"C:\Program Files\Note\note.txt");
note.Close();
sw = new StreamWriter(@"C:\Program Files\Note\note.txt");
sw.Write("Have a nice day\nWel-come from Priyank");
sw.Close();
}
}

SubashPosted Sep 28, 2016, 6:55 AM
Good one piyank
saida zeenathPosted Dec 20, 2010, 6:04 AM
this c sharpcorner site is very helpful to all learner.I learned more from this site. Thank you