public void refreshNotes(Panel sketchPanel, ArrayList notesArrayList) { //first the opca panels from the time lines foreach (Control cont in notesControlsArrayList) { this.sketchPanel.Controls.Remove(cont); } //clear the array list notesControlsArrayList.Clear(); for (int Counter = 0; Counter < notesArrayList.Count; Counter++) { Note note = (Note)notesArrayList[Counter]; AmitNoteControl.AmitNoteUserControl controlNote = new AmitNoteControl.AmitNoteUserControl(); //Point elipsePoint=new Point(note.p.X,note.p.Y-6); //Point linePoint=new Point(note.p.X,note.p.Y); controlNote.Size = new Size(noteWidth, noteWidth * 5 / 4); controlNote.Location = note.p; controlNote.p = note.p; controlNote.direction = note.direction; controlNote.type = note.type; controlNote.doted = note.doted; controlNote.dashed = note.dashed; controlNote.accidental = note.accidental; controlNote.Click += new System.EventHandler(this.NoteControl_Click); notesControlsArrayList.Add(controlNote); sketchPanel.Controls.Add(controlNote); controlNote.BringToFront(); } }
/// <summary> /// The main entry point for the application. /// </summary> //[STAThread] //static void Main() //{ // Application.Run(new Finale()); //} /*private void StafPanel_Click(object sender, System.EventArgs e) * { * stafPanelWasClicked=true; * MessageBox.Show(" staf" ); * }*/ private void NoteControl_Click(object sender, System.EventArgs e) { AmitNoteControl.AmitNoteUserControl controlNote = (AmitNoteControl.AmitNoteUserControl)sender; for (int x = 0; x < this.notesArrayList.Count; x++) { AmitNoteControl.AmitNoteUserControl tmp = (AmitNoteControl.AmitNoteUserControl) this.notesControlsArrayList[x]; if (tmp.p == controlNote.p) { this.notesArrayList.RemoveAt(x); } } this.numberOfNotes--; refreshNotes(this.sketchPanel, this.notesArrayList); }