コード例 #1
0
        private void Enregistrement_Click(object sender, EventArgs e)
        {
            try
            {
                if (this.MdiChildren.Count() >= 1 && this.ActiveMdiChild
                    != null)
                {
                    ScribblerNoteForm scribbler;
                    scribbler = this.ActiveMdiChild as ScribblerNoteForm;

                    if (sender == enregistrerToolStripButton || sender ==
                        enregistrerToolStripMenuItem)
                    {
                        scribbler.Enregistrer();
                    }
                    else
                    {
                        scribbler.EnregistrerSous();
                    }
                    noteToolStripStatusLabel.Text = this.ActiveMdiChild.Text;
                }
                else
                {
                    ScribblerNoteForm scribbler = this.ActiveMdiChild as
                                                  ScribblerNoteForm;
                    scribbler.Close();
                }
            }
            catch (Exception)
            {
                MessageBox.Show(gen.MessagesErreurs[(int)em.EmEnregistrementErreur]
                                + Environment.NewLine.ToString());
            }
        }
コード例 #2
0
        private void Fermer_Click(object sender, EventArgs e)
        {
            ScribblerNoteForm scribbler = this.ActiveMdiChild as
                                          ScribblerNoteForm;

            if (this.ActiveControl != null)
            {
                scribbler.Close();
            }
        }
コード例 #3
0
        private void policeToolStripMenuItem_Click(object sender, EventArgs e)
        {
            try
            {
                ScribblerNoteForm oScribbler = this.ActiveMdiChild as ScribblerNoteForm;
                RichTextBox       rtb        = oScribbler.noteRichTextBox;

                scribblerFontDialog.Font = oScribbler.noteRichTextBox.SelectionFont;

                if (scribblerFontDialog.ShowDialog() == DialogResult.OK)
                {
                    rtb.SelectionFont = scribblerFontDialog.Font;
                }
            }
            catch (Exception)
            {
                MessageBox.Show(em.EmStylePolice.ToString());
            }
        }
コード例 #4
0
        /// <summary>
        /// Crée une nouvelle note
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void NouvelleNote_Click(object sender, EventArgs e)
        {
            ScribblerNoteForm Note;

            countFen++;
            try
            {
                ActiverOperationsMenusBarreOutils();

                Note           = new ScribblerNoteForm();
                Note.MdiParent = this;
                Note.Show();
                Note.Text += countFen;

                Note.ModeInserer = true; //Mode inserer actif
            }
            catch (Exception)
            {
                MessageBox.Show(em.EmDocument.ToString());
            }
        }
コード例 #5
0
        private void Ouvrir_Click(object sender, EventArgs e)
        {
            try
            {
                ActiverOperationsMenusBarreOutils();

                scribblerOpenFileDialog.InitialDirectory = initialdirectory;

                if (scribblerOpenFileDialog.ShowDialog() == DialogResult.OK)
                {
                    if (scribblerOpenFileDialog.FileName.EndsWith
                            ("rtf", StringComparison.CurrentCulture))
                    {
                        ScribblerNoteForm scribbler = new
                                                      ScribblerNoteForm();
                        scribbler.Text      = scribblerOpenFileDialog.FileName;
                        scribbler.MdiParent = this;
                        scribbler.noteRichTextBox.LoadFile
                            (scribblerOpenFileDialog.FileName);
                        scribbler.noteRichTextBox.Modified = false;
                        scribbler.enregistrerBool          = true;
                        scribbler.Show();
                        scribblerOpenFileDialog.InitialDirectory =
                            scribblerOpenFileDialog.FileName;
                        initialdirectory = scribblerOpenFileDialog.FileName;

                        scribbler.ModeInserer = true; // Mode inserer actif
                    }
                }
            }
            catch (Exception)
            {
                MessageBox.Show(gen.MessagesErreurs[(int)em.EmOuvrirErreur] +
                                Environment.NewLine.ToString());
            }
        }