Example #1
0
        private void Form1_Load(object sender, EventArgs e)
        {
            this.Text = "PTT Helper";
            #region Data
            dataGridView1.ColumnCount = 5;                             // 定義所需要的行數
            //dataGridView1.AutoSize = true;
            dataGridView1.Columns[0].Name = "Pop";
            dataGridView1.Columns[1].Name = "Title";
            dataGridView1.Columns[2].Name = "author";
            dataGridView1.Columns[3].Name = "URL";
            dataGridView1.Columns[4].Name = "Text";

            dataGridView1.Columns[0].AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells;
            dataGridView1.Columns[1].AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells;
            dataGridView1.Columns[2].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            dataGridView1.Columns[3].AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells;

            dataGridView1.Columns[3].Visible = false;
            dataGridView1.Columns[4].Visible = false;

            this.dataGridView1.DefaultCellStyle.BackColor = Color.Black;

            //
            //dataGridView2.ColumnCount = 1;
            //dataGridView2.Columns[0].Name = "Push";
            //dataGridView2.Columns[0].AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells;
            #endregion
            #region Console
            AllocConsole();
            //Console.Beep();
            Console.OutputEncoding = Encoding.UTF8;
            ConsoleColor oriColor = Console.ForegroundColor;
            Console.ForegroundColor = ConsoleColor.Yellow;
            Console.WriteLine("* Don't close this console window or the application will also close.");
            Console.ForegroundColor = oriColor;
            #endregion
            #region ComboBox
            String[] str_combox = { "Gossiping",   "Gov_owned", "Stock", "Option", "FATE_GO", "Soft_Job", "Tech_Job", "HardwareSale", "C_Chat",
                                    "nb-shopping", "car",       "sex",   };
            foreach (string fucktoken in str_combox)
            {
                comboBox1.Items.Add(fucktoken);
            }
            #endregion
            Properties.Settings MySetting = new Properties.Settings();//Resource Define
            textBox1.Text = MySetting.str_page;
        }
Example #2
0
 private void Form1_FormClosed(object sender, FormClosedEventArgs e)
 {
     Properties.Settings MySetting = new Properties.Settings();//Resource Define
     MySetting.str_page = textBox1.Text;
     MySetting.Save();
 }