using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using Pub_Class; namespace Kanban { /* ±êÌâ: 1.±êÌâÎı¾(Title-Caption) 2.×ÖÌåÑÕÉ«(Title-ForeColor) 3.×ÖÌåÀàÐÍ,´óС,´ÖÌå(Title-FontFamily)(Title-FontSize)(Title-FontStyle) 4.´°ÌåÑÕÉ«(Title-BackColor) 5.ÿҳÐÐÊý(Title-PageRows) 6.·­Ò³¼ä¸ô(Title-PageDownTimer) 7.ˢмä¸ô(Title-DisplayTimer) ±êÌâÐÐ: 1.×ÖÌåÑÕÉ«(Header-ForeColor) 2.×ÖÌåÀàÐÍ,´óС,´ÖÌå(Header-FontFamily)(Header-FontSize)(Header-FontStyle) 3.±³¾°ÑÕÉ«(Header-BackColor) 4.¶ÔÆë·½Ê½(Header-Alignment) 5.Ðиß(Header-RowHeight) ÄÚÈÝÐÐ: 1.×ÖÌåÑÕÉ«(Cell-ForeColor) 2.×ÖÌåÀàÐÍ,´óС,´ÖÌå(Cell-FontFamily)(Cell-FontSize)(Cell-FontStyle) 3.´ó±³¾°ÑÕÉ«(Cell-BackColor) 4.¶ÔÆë·½Ê½(Cell-Alignment) 5.Ðиß(Cell-RowHeight) 6.ÆæÊýÐб³¾°ÑÕÉ«(Cell-AlternatingBackColor) 7.żÊýÐб³¾°ÑÕÉ«(Cell-DefaultBackColor) */ /// /// /// public partial class Kanban_BaseSet : Form { public Kanban_BaseSet() { InitializeComponent(); } public string HName; private void button1_Click(object sender, EventArgs e) { ColorDialog oColor = new ColorDialog(); if (oColor.ShowDialog() == DialogResult.OK) { textBox2.BackColor = oColor.Color; string s = System.Drawing.ColorTranslator.ToHtml(oColor.Color); textBox2.Text = s; textBox4.ForeColor = System.Drawing.ColorTranslator.FromHtml(s); } } private void button2_Click(object sender, EventArgs e) { ColorDialog oColor = new ColorDialog(); if (oColor.ShowDialog() == DialogResult.OK) { textBox3.BackColor = oColor.Color; string s = System.Drawing.ColorTranslator.ToHtml(oColor.Color); textBox3.Text = s; textBox4.BackColor = System.Drawing.ColorTranslator.FromHtml(s); } } private void button3_Click(object sender, EventArgs e) { FontDialog oFont = new FontDialog(); if (oFont.ShowDialog() == DialogResult.OK) { textBox5.Text = oFont.Font.FontFamily.ToString(); textBox13.Text = oFont.Font.Size.ToString(); textBox14.Text = oFont.Font.Style.ToString(); if (textBox14.Text.Contains("Bold")) { textBox4.Font = new Font(oFont.Font.FontFamily.ToString(), oFont.Font.Size, FontStyle.Bold); } else { textBox4.Font = new Font(oFont.Font.FontFamily.ToString(), oFont.Font.Size); } } } private void button4_Click(object sender, EventArgs e) { ColorDialog oColor = new ColorDialog(); if (oColor.ShowDialog() == DialogResult.OK) { textBox6.BackColor = oColor.Color; string s = System.Drawing.ColorTranslator.ToHtml(oColor.Color); textBox6.Text = s; textBox9.ForeColor = System.Drawing.ColorTranslator.FromHtml(s); } } private void button6_Click(object sender, EventArgs e) { ColorDialog oColor = new ColorDialog(); if (oColor.ShowDialog() == DialogResult.OK) { textBox8.BackColor = oColor.Color; string s = System.Drawing.ColorTranslator.ToHtml(oColor.Color); textBox8.Text = s; textBox9.BackColor = System.Drawing.ColorTranslator.FromHtml(s); } } private void button5_Click(object sender, EventArgs e) { FontDialog oFont = new FontDialog(); if (oFont.ShowDialog() == DialogResult.OK) { textBox7.Text = oFont.Font.FontFamily.ToString(); textBox18.Text = oFont.Font.Size.ToString(); textBox12.Text = oFont.Font.Style.ToString(); if (textBox12.Text.Contains("Bold")) { textBox9.Font = new Font(oFont.Font.FontFamily.ToString(), oFont.Font.Size, FontStyle.Bold); } else { textBox9.Font = new Font(oFont.Font.FontFamily.ToString(), oFont.Font.Size); } } } private void button8_Click(object sender, EventArgs e) { ColorDialog oColor = new ColorDialog(); if (oColor.ShowDialog() == DialogResult.OK) { textBox21.BackColor = oColor.Color; string s = System.Drawing.ColorTranslator.ToHtml(oColor.Color); textBox21.Text = s; textBox26.ForeColor = System.Drawing.ColorTranslator.FromHtml(s); } } private void button9_Click(object sender, EventArgs e) { ColorDialog oColor = new ColorDialog(); if (oColor.ShowDialog() == DialogResult.OK) { textBox22.BackColor = oColor.Color; string s = System.Drawing.ColorTranslator.ToHtml(oColor.Color); textBox22.Text = s; textBox22.BackColor = System.Drawing.ColorTranslator.FromHtml(s); } } private void button7_Click(object sender, EventArgs e) { FontDialog oFont = new FontDialog(); if (oFont.ShowDialog() == DialogResult.OK) { textBox20.Text = oFont.Font.FontFamily.ToString(); textBox19.Text = oFont.Font.Size.ToString(); textBox11.Text = oFont.Font.Style.ToString(); if (textBox11.Text.Contains("Bold")) { textBox26.Font = new Font(oFont.Font.FontFamily.ToString(), oFont.Font.Size, FontStyle.Bold); } else { textBox26.Font = new Font(oFont.Font.FontFamily.ToString(), oFont.Font.Size); } } } private void button10_Click(object sender, EventArgs e) { ColorDialog oColor = new ColorDialog(); if (oColor.ShowDialog() == DialogResult.OK) { textBox24.BackColor = oColor.Color; string s = System.Drawing.ColorTranslator.ToHtml(oColor.Color); textBox24.Text = s; textBox26.BackColor = System.Drawing.ColorTranslator.FromHtml(s); } } private void button11_Click(object sender, EventArgs e) { ColorDialog oColor = new ColorDialog(); if (oColor.ShowDialog() == DialogResult.OK) { textBox25.BackColor = oColor.Color; string s = System.Drawing.ColorTranslator.ToHtml(oColor.Color); textBox25.Text = s; textBox26.BackColor = System.Drawing.ColorTranslator.FromHtml(s); } } private void button12_Click(object sender, EventArgs e) { //-------------------------------------±êÌâ ClsIni.WriteIni(HName, "Title-Caption", textBox1.Text, DBUtility.ClsPub.AppPath + @"/KanbanInfo.ini"); ClsIni.WriteIni(HName, "Title-ForeColor", textBox2.Text, DBUtility.ClsPub.AppPath + @"/KanbanInfo.ini"); ClsIni.WriteIni(HName, "Title-FontFamily", textBox5.Text, DBUtility.ClsPub.AppPath + @"/KanbanInfo.ini"); ClsIni.WriteIni(HName, "Title-FontSize", textBox13.Text, DBUtility.ClsPub.AppPath + @"/KanbanInfo.ini"); ClsIni.WriteIni(HName, "Title-FontStyle", textBox14.Text, DBUtility.ClsPub.AppPath + @"/KanbanInfo.ini"); ClsIni.WriteIni(HName, "Title-BackColor", textBox3.Text, DBUtility.ClsPub.AppPath + @"/KanbanInfo.ini"); ClsIni.WriteIni(HName, "Title-PageRows", textBox15.Text, DBUtility.ClsPub.AppPath + @"/KanbanInfo.ini"); ClsIni.WriteIni(HName, "Title-PageDownTimer", textBox16.Text, DBUtility.ClsPub.AppPath + @"/KanbanInfo.ini"); ClsIni.WriteIni(HName, "Title-DisplayTimer", textBox17.Text, DBUtility.ClsPub.AppPath + @"/KanbanInfo.ini"); //-----------------------------------±êÌâÐÐ ClsIni.WriteIni(HName, "Header-ForeColor", textBox6.Text, DBUtility.ClsPub.AppPath + @"/KanbanInfo.ini"); ClsIni.WriteIni(HName, "Header-FontFamily", textBox7.Text, DBUtility.ClsPub.AppPath + @"/KanbanInfo.ini"); ClsIni.WriteIni(HName, "Header-FontSize", textBox18.Text, DBUtility.ClsPub.AppPath + @"/KanbanInfo.ini"); ClsIni.WriteIni(HName, "Header-FontStyle", textBox12.Text, DBUtility.ClsPub.AppPath + @"/KanbanInfo.ini"); ClsIni.WriteIni(HName, "Header-BackColor", textBox8.Text, DBUtility.ClsPub.AppPath + @"/KanbanInfo.ini"); ClsIni.WriteIni(HName, "Header-Alignment", comboBox1.Text, DBUtility.ClsPub.AppPath + @"/KanbanInfo.ini"); ClsIni.WriteIni(HName, "Header-RowHeight", textBox10.Text, DBUtility.ClsPub.AppPath + @"/KanbanInfo.ini"); ClsIni.WriteIni(HName, "Header-ColWidth", textBox28.Text, DBUtility.ClsPub.AppPath + @"/KanbanInfo.ini"); //----------------------------------ÄÚÈÝÐÐ ClsIni.WriteIni(HName, "Cell-ForeColor", textBox21.Text, DBUtility.ClsPub.AppPath + @"/KanbanInfo.ini"); ClsIni.WriteIni(HName, "Cell-FontFamily", textBox20.Text, DBUtility.ClsPub.AppPath + @"/KanbanInfo.ini"); ClsIni.WriteIni(HName, "Cell-FontSize", textBox19.Text, DBUtility.ClsPub.AppPath + @"/KanbanInfo.ini"); ClsIni.WriteIni(HName, "Cell-FontStyle", textBox11.Text, DBUtility.ClsPub.AppPath + @"/KanbanInfo.ini"); ClsIni.WriteIni(HName, "Cell-BackColor", textBox22.Text, DBUtility.ClsPub.AppPath + @"/KanbanInfo.ini"); ClsIni.WriteIni(HName, "Cell-Alignment", comboBox2.Text, DBUtility.ClsPub.AppPath + @"/KanbanInfo.ini"); ClsIni.WriteIni(HName, "Cell-RowHeight", textBox23.Text, DBUtility.ClsPub.AppPath + @"/KanbanInfo.ini"); ClsIni.WriteIni(HName, "Cell-AlternatingBackColor", textBox24.Text, DBUtility.ClsPub.AppPath + @"/KanbanInfo.ini"); ClsIni.WriteIni(HName, "Cell-DefaultBackColor", textBox25.Text, DBUtility.ClsPub.AppPath + @"/KanbanInfo.ini"); MessageBox.Show("±£´æ³É¹¦£¡"); this.Close(); } private void button13_Click(object sender, EventArgs e) { this.Close(); } private void Kanban_BaseSet_Load(object sender, EventArgs e) { textBox1.Text = ClsIni.ReadIni(HName, "Title-Caption", DBUtility.ClsPub.AppPath + @"/KanbanInfo.ini"); textBox2.Text = ClsIni.ReadIni(HName, "Title-ForeColor", DBUtility.ClsPub.AppPath + @"/KanbanInfo.ini"); textBox5.Text = ClsIni.ReadIni(HName, "Title-FontFamily", DBUtility.ClsPub.AppPath + @"/KanbanInfo.ini"); textBox13.Text = ClsIni.ReadIni(HName, "Title-FontSize", DBUtility.ClsPub.AppPath + @"/KanbanInfo.ini"); textBox14.Text = ClsIni.ReadIni(HName, "Title-FontStyle", DBUtility.ClsPub.AppPath + @"/KanbanInfo.ini"); textBox3.Text = ClsIni.ReadIni(HName, "Title-BackColor", DBUtility.ClsPub.AppPath + @"/KanbanInfo.ini"); textBox15.Text = ClsIni.ReadIni(HName, "Title-PageRows", DBUtility.ClsPub.AppPath + @"/KanbanInfo.ini"); textBox16.Text = ClsIni.ReadIni(HName, "Title-PageDownTimer", DBUtility.ClsPub.AppPath + @"/KanbanInfo.ini"); textBox17.Text = ClsIni.ReadIni(HName, "Title-DisplayTimer", DBUtility.ClsPub.AppPath + @"/KanbanInfo.ini"); if (textBox1.Text == "ûÓÐÕÒµ½£¡") { textBox1.Text = ""; } if (textBox15.Text == "ûÓÐÕÒµ½£¡") { textBox15.Text = ""; } if (textBox16.Text == "ûÓÐÕÒµ½£¡") { textBox16.Text = ""; } if (textBox17.Text == "ûÓÐÕÒµ½£¡") { textBox17.Text = ""; } if (textBox2.Text != "" && textBox2.Text != "ûÓÐÕÒµ½£¡") { textBox2.BackColor = System.Drawing.ColorTranslator.FromHtml(textBox2.Text); textBox4.ForeColor = System.Drawing.ColorTranslator.FromHtml(textBox2.Text); } else { textBox2.Text = ""; } if (textBox3.Text != "" && textBox3.Text != "ûÓÐÕÒµ½£¡") { textBox3.BackColor = System.Drawing.ColorTranslator.FromHtml(textBox3.Text); textBox4.BackColor = System.Drawing.ColorTranslator.FromHtml(textBox3.Text); } else { textBox3.Text = ""; } if (textBox14.Text != "" && textBox14.Text != "ûÓÐÕÒµ½£¡") { if (textBox14.Text.Contains("Bold")) { textBox4.Font = new Font(textBox5.Text, DBUtility.ClsPub.isSingle(textBox13.Text), FontStyle.Bold); } else { textBox4.Font = new Font(textBox5.Text, DBUtility.ClsPub.isSingle(textBox13.Text)); } } else { textBox5.Text = ""; textBox13.Text = ""; textBox14.Text = ""; } textBox6.Text = ClsIni.ReadIni(HName, "Header-ForeColor", DBUtility.ClsPub.AppPath + @"/KanbanInfo.ini"); textBox7.Text = ClsIni.ReadIni(HName, "Header-FontFamily", DBUtility.ClsPub.AppPath + @"/KanbanInfo.ini"); textBox18.Text = ClsIni.ReadIni(HName, "Header-FontSize", DBUtility.ClsPub.AppPath + @"/KanbanInfo.ini"); textBox12.Text = ClsIni.ReadIni(HName, "Header-FontStyle", DBUtility.ClsPub.AppPath + @"/KanbanInfo.ini"); textBox8.Text = ClsIni.ReadIni(HName, "Header-BackColor", DBUtility.ClsPub.AppPath + @"/KanbanInfo.ini"); comboBox1.Text = ClsIni.ReadIni(HName, "Header-Alignment", DBUtility.ClsPub.AppPath + @"/KanbanInfo.ini"); textBox10.Text = ClsIni.ReadIni(HName, "Header-RowHeight", DBUtility.ClsPub.AppPath + @"/KanbanInfo.ini"); textBox28.Text = ClsIni.ReadIni(HName, "Header-ColWidth", DBUtility.ClsPub.AppPath + @"/KanbanInfo.ini"); if (textBox28.Text == "ûÓÐÕÒµ½£¡") { textBox28.Text = ""; } if (textBox10.Text == "ûÓÐÕÒµ½£¡") { textBox10.Text = ""; } if (textBox6.Text != "" && textBox6.Text != "ûÓÐÕÒµ½£¡") { textBox6.BackColor = System.Drawing.ColorTranslator.FromHtml(textBox6.Text); textBox9.ForeColor = System.Drawing.ColorTranslator.FromHtml(textBox6.Text); } else { textBox6.Text = ""; } if (textBox8.Text != "" && textBox8.Text != "ûÓÐÕÒµ½£¡") { textBox8.BackColor = System.Drawing.ColorTranslator.FromHtml(textBox8.Text); textBox9.BackColor = System.Drawing.ColorTranslator.FromHtml(textBox8.Text); } else { textBox8.Text = ""; } if (textBox12.Text != "" && textBox12.Text != "ûÓÐÕÒµ½£¡") { if (textBox12.Text.Contains("Bold")) { textBox9.Font = new Font(textBox7.Text, DBUtility.ClsPub.isSingle(textBox18.Text), FontStyle.Bold); } else { textBox9.Font = new Font(textBox7.Text, DBUtility.ClsPub.isSingle(textBox18.Text)); } } else { textBox7.Text = ""; textBox18.Text = ""; textBox12.Text = ""; } if (comboBox1.Text != "" && comboBox1.Text != "ûÓÐÕÒµ½£¡") { if (comboBox1.Text == "×ó¶ÔÆë") { textBox9.TextAlign = HorizontalAlignment.Left; } if (comboBox1.Text == "ÓÒ¶ÔÆë") { textBox9.TextAlign = HorizontalAlignment.Right; } if (comboBox1.Text == "¾ÓÖÐ") { textBox9.TextAlign = HorizontalAlignment.Center; } } else { comboBox1.Text = ""; } textBox21.Text = ClsIni.ReadIni(HName, "Cell-ForeColor", DBUtility.ClsPub.AppPath + @"/KanbanInfo.ini"); textBox20.Text = ClsIni.ReadIni(HName, "Cell-FontFamily", DBUtility.ClsPub.AppPath + @"/KanbanInfo.ini"); textBox19.Text = ClsIni.ReadIni(HName, "Cell-FontSize", DBUtility.ClsPub.AppPath + @"/KanbanInfo.ini"); textBox11.Text = ClsIni.ReadIni(HName, "Cell-FontStyle", DBUtility.ClsPub.AppPath + @"/KanbanInfo.ini"); textBox22.Text = ClsIni.ReadIni(HName, "Cell-BackColor", DBUtility.ClsPub.AppPath + @"/KanbanInfo.ini"); comboBox2.Text = ClsIni.ReadIni(HName, "Cell-Alignment", DBUtility.ClsPub.AppPath + @"/KanbanInfo.ini"); textBox23.Text = ClsIni.ReadIni(HName, "Cell-RowHeight", DBUtility.ClsPub.AppPath + @"/KanbanInfo.ini"); textBox24.Text = ClsIni.ReadIni(HName, "Cell-AlternatingBackColor", DBUtility.ClsPub.AppPath + @"/KanbanInfo.ini"); textBox25.Text = ClsIni.ReadIni(HName, "Cell-DefaultBackColor", DBUtility.ClsPub.AppPath + @"/KanbanInfo.ini"); if (textBox23.Text == "ûÓÐÕÒµ½£¡") { textBox23.Text = ""; } if (textBox21.Text != "" && textBox21.Text != "ûÓÐÕÒµ½£¡") { textBox21.BackColor = System.Drawing.ColorTranslator.FromHtml(textBox21.Text); textBox26.ForeColor = System.Drawing.ColorTranslator.FromHtml(textBox21.Text); } else { textBox21.Text = ""; } if (textBox22.Text != "" && textBox22.Text != "ûÓÐÕÒµ½£¡") { textBox22.BackColor = System.Drawing.ColorTranslator.FromHtml(textBox22.Text); textBox26.BackColor = System.Drawing.ColorTranslator.FromHtml(textBox22.Text); } else { textBox22.Text = ""; } if (textBox11.Text != "" && textBox11.Text != "ûÓÐÕÒµ½£¡") { if (textBox11.Text.Contains("Bold")) { textBox26.Font = new Font(textBox20.Text, DBUtility.ClsPub.isSingle(textBox19.Text), FontStyle.Bold); } else { textBox26.Font = new Font(textBox20.Text, DBUtility.ClsPub.isSingle(textBox19.Text)); } } else { textBox20.Text = ""; textBox19.Text = ""; textBox11.Text = ""; } if (comboBox2.Text != "" && comboBox2.Text != "ûÓÐÕÒµ½£¡") { if (comboBox2.Text == "×ó¶ÔÆë") { textBox26.TextAlign = HorizontalAlignment.Left; } if (comboBox2.Text == "ÓÒ¶ÔÆë") { textBox26.TextAlign = HorizontalAlignment.Right; } if (comboBox2.Text == "¾ÓÖÐ") { textBox26.TextAlign = HorizontalAlignment.Center; } } else { comboBox2.Text = ""; } if (textBox24.Text != "" && textBox24.Text != "ûÓÐÕÒµ½£¡") { textBox24.BackColor = System.Drawing.ColorTranslator.FromHtml(textBox24.Text); textBox26.BackColor = System.Drawing.ColorTranslator.FromHtml(textBox24.Text); } else { textBox24.Text = ""; } if (textBox25.Text != "" && textBox25.Text != "ûÓÐÕÒµ½£¡") { textBox25.BackColor = System.Drawing.ColorTranslator.FromHtml(textBox25.Text); textBox26.BackColor = System.Drawing.ColorTranslator.FromHtml(textBox25.Text); } else { textBox25.Text = ""; } } private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) { if (comboBox1.Text == "×ó¶ÔÆë") { textBox9.TextAlign = HorizontalAlignment.Left; } if (comboBox1.Text == "ÓÒ¶ÔÆë") { textBox9.TextAlign = HorizontalAlignment.Right; } if (comboBox1.Text == "¾ÓÖÐ") { textBox9.TextAlign = HorizontalAlignment.Center; } } private void comboBox2_SelectedIndexChanged(object sender, EventArgs e) { if (comboBox2.Text == "×ó¶ÔÆë") { textBox26.TextAlign = HorizontalAlignment.Left; } if (comboBox2.Text == "ÓÒ¶ÔÆë") { textBox26.TextAlign = HorizontalAlignment.Right; } if (comboBox2.Text == "¾ÓÖÐ") { textBox26.TextAlign = HorizontalAlignment.Center; } } } }