Ejemplo n.º 1
0
        private void LogText_TextChanged(object sender, EventArgs e)
        {
            int i = LogText.SelectionStart;

            Page[currentPage] = LogText.Text;
            LogText.SelectAll();
            LogText.SelectionFont = new Font(LogText.Font.FontFamily, LogText.Font.Size, LogText.Font.Style);
            LogText.DeselectAll();
            LogText.SelectionStart = i;
            writtenLetters++;
            if (writtenLetters == 25 && autoSave)
            {
                writtenLetters = 0;
                string backcolor = LogText.BackColor.R + "@" + LogText.BackColor.G + "@" + LogText.BackColor.B;
                string forecolor = LogText.ForeColor.R + "@" + LogText.ForeColor.G + "@" + LogText.ForeColor.B;
                int[]  style     = new int[3];
                if (LogText.Font.Bold)
                {
                    style[0] = 1;
                }
                if (LogText.Font.Italic)
                {
                    style[1] = 1;
                }
                if (LogText.Font.Underline)
                {
                    style[2] = 1;
                }
                LogOperations.saveTheLog(parentForm.activeUser, header.Text, Page, backcolor, forecolor, LogText.Font.FontFamily.Name, Convert.ToInt32(LogText.Font.Size), style, alig);
            }
        }
Ejemplo n.º 2
0
        private void save_Click(object sender, EventArgs e)
        {
            string backcolor = LogText.BackColor.R + "@" + LogText.BackColor.G + "@" + LogText.BackColor.B;
            string forecolor = LogText.ForeColor.R + "@" + LogText.ForeColor.G + "@" + LogText.ForeColor.B;

            int[] style = new int[3];
            if (LogText.Font.Bold)
            {
                style[0] = 1;
            }
            if (LogText.Font.Italic)
            {
                style[1] = 1;
            }
            if (LogText.Font.Underline)
            {
                style[2] = 1;
            }
            LogOperations.saveTheLog(parentForm.activeUser, header.Text, Page, backcolor, forecolor, LogText.Font.FontFamily.Name, Convert.ToInt32(LogText.Font.Size), style, alig);
            MessageBox.Show("Saved");
        }