static public NoteForm CreateNewNote(List <NoteForm> toCheck) { NoteForm toCreate = new NoteForm(); CreateNote notes = new CreateNote(toCreate); notes.toCheck = toCheck; notes.ShowDialog(); if (toCreate.Name != null) { return(toCreate); } return(default);
// Button, which allows us to make new note private void toolStripButtonAdd_Click(object sender, EventArgs e) { timerNoteNotify.Stop(); NoteForm toAdd = CreateNote.CreateNewNote(notes); if (toAdd != default) { notes.Add(toAdd); listViewNotes.Items.Insert(0, toAdd.Name); listViewNotes.Items[0].SubItems.Add(toAdd.ToNotify.ToShortDateString() + " | " + toAdd.ToNotify.ToShortTimeString()); } timerNoteNotify.Start(); RelevantCheck(); }
public NoteShow(NoteForm toShow) { InitializeComponent(); Top = (int)SystemParameters.VirtualScreenHeight - (Bottom - Top) - 50; Left = (int)SystemParameters.VirtualScreenWidth - (Right - Left); toChange = toShow; textBoxMessage.ReadOnly = toShow.IsReadOnly; readonlyToolStripMenuItem.Checked = toShow.IsReadOnly; toolStripStatusLabelName.Text = toShow.Name; textBoxMessage.Text = toShow.Message; toolStripStatusLabelToNotify.Text = toShow.ToNotify.ToShortDateString() + " | " + toShow.ToNotify.ToShortTimeString(); textBoxMessage.Font = toShow.FontType; textBoxMessage.ForeColor = toShow.FontColor; textBoxMessage.BackColor = toShow.BackGroundColor; }
public CreateNote(NoteForm workWith) { InitializeComponent(); allAvaibleMusic = new List <string>(); this.workWith = workWith; workWith.FontType = Font; workWith.FontColor = Color.Black; workWith.BackGroundColor = Color.White; textBoxFont.Text = Font.Name; if (!Directory.Exists("Music")) { Directory.CreateDirectory("Music"); } allAvaibleMusic = Directory.GetFiles(Directory.GetCurrentDirectory() + "\\Music").ToList(); string[] fileToAdd; for (int i = 0; i < allAvaibleMusic.Count; i++) { fileToAdd = allAvaibleMusic[i].Split('\\'); comboBoxMusic.Items.Add(fileToAdd[fileToAdd.Length - 1]); } numericUpDownHours.Value = DateTime.Now.Hour; numericUpDownMinutes.Value = DateTime.Now.Minute; dateTimePickerToNotify.MinDate = DateTime.Now; textBoxName.MouseHover += (s, e) => { toolTipShow.SetToolTip(textBoxName, "Name field"); }; dateTimePickerToNotify.MouseHover += (s, e) => { toolTipShow.SetToolTip(dateTimePickerToNotify, "Data to notify"); }; textBoxFont.MouseHover += (s, e) => { toolTipShow.SetToolTip(textBoxFont, "Font. Click to change its type"); }; comboBoxMusic.MouseHover += (s, e) => { toolTipShow.SetToolTip(comboBoxMusic, "Music\n Click: choose existing one\n Press button on the right to import new one"); }; buttonCancel.Click += (s, e) => { workWith.Name = null; Close(); }; }