//初始化 private void FormMain_Load(object sender, EventArgs e) { //My.Buckets Buckets1 = new My.Buckets("MWMWMWMWMWMMWMWMWMWMWM", "1111"); //My.Buckets Buckets2 = new My.Buckets("GHIJKLXYZMNOPQRWMHMNOPQRWMH", "2222"); //My.Buckets Buckets3 = new My.Buckets("MNOPQRWMHMNOPQRWMH", "3333"); //My.LoginedBuckets = new My.Buckets[] { Buckets1, Buckets2, Buckets3 }; //玻璃效果 MyGlassEffect Glass = new MyGlassEffect(); if (MyGlassEffect.GlassEnabled) { Rectangle ScreenArea = System.Windows.Forms.Screen.GetWorkingArea(this); Glass.TopBarSize = dataGridView1.Top; Glass.LeftBarSize = 0; Glass.BottomBarSize = this.Height - dataGridView1.Top - dataGridView1.Height - 38; Glass.RightBarSize = 0; Glass.GlassLabel = new Label[] { label1, label2 }; Glass.ShowEffect(this); } //窗体属性 this.ControlBox = false; this.Icon = Properties.Resources.logo; this.StartPosition = FormStartPosition.CenterScreen; this.Text = "【" + My.MyProjectName + "】" + " 月翼科技"; this.TopMost = true; this.TopMost = false; //动态增加控件 FormMainButton = new System.Windows.Forms.Button[My.LoginedBuckets.Length]; for (int i = 0; i < My.LoginedBuckets.Length; i++) { FormMainButton[i] = new System.Windows.Forms.Button(); FormMainButton[i].BackColor = System.Drawing.Color.Black; FormMainButton[i].Dock = System.Windows.Forms.DockStyle.Left; FormMainButton[i].FlatStyle = System.Windows.Forms.FlatStyle.Flat; FormMainButton[i].ForeColor = System.Drawing.Color.FromArgb(192, 192, 255); FormMainButton[i].Location = new System.Drawing.Point(0, 0); FormMainButton[i].Name = "FormMainButton" + i; FormMainButton[i].Size = new System.Drawing.Size(150, 44); FormMainButton[i].TabIndex = 0; if (My.LoginedBuckets[i].Name.Length > 8)//显示的字数长度限制 { FormMainButton[i].Text = My.LoginedBuckets[i].Name.Substring(0, 8) + "…"; } else { FormMainButton[i].Text = My.LoginedBuckets[i].Name; } this.toolTip1.SetToolTip(FormMainButton[i], My.LoginedBuckets[i].Name);//鼠标悬停的提示 FormMainButton[i].UseVisualStyleBackColor = false; this.panel1.Controls.Add(FormMainButton[i]); FormMainButton[i].Click += new System.EventHandler(this.FormMainButton_Click); } ChosenButtomIndex = 0; FormMainButton[ChosenButtomIndex].FlatAppearance.BorderColor = Color.Fuchsia; FormMainButton[ChosenButtomIndex].FlatAppearance.BorderSize = 3; this.panel1.Width = My.LoginedBuckets.Length * 150; }
//初始化 private void FormLoading_Load(object sender, EventArgs e) { //玻璃效果 MyGlassEffect Glass = new MyGlassEffect(); if (MyGlassEffect.GlassEnabled) { Rectangle ScreenArea = System.Windows.Forms.Screen.GetWorkingArea(this); Glass.TopBarSize = ScreenArea.Height; Glass.LeftBarSize = ScreenArea.Width; Glass.BottomBarSize = ScreenArea.Height; Glass.RightBarSize = ScreenArea.Width; Glass.GlassLabel = new Label[] { label1 }; Glass.ShowEffect(this); } //窗体属性 this.TopMost = true; this.TopMost = false; //this.ControlBox = false; this.Icon = Properties.Resources.logo; this.StartPosition = FormStartPosition.CenterScreen; this.Text = "【" + My.MyProjectName + "】" + " 正在启动……"; //动图Loading pictureBox1.Image = Properties.Resources.loading; this.Size = new Size(pictureBox1.Image.Width + 20, pictureBox1.Image.Height + 100); this.Left = (Screen.PrimaryScreen.Bounds.Width - this.Width) / 2; this.Top = (Screen.PrimaryScreen.Bounds.Height - this.Height) / 2; pictureBox1.Width = pictureBox1.Image.Width; pictureBox1.Height = pictureBox1.Image.Height; pictureBox1.Left = (this.Width - pictureBox1.Width) / 2 - 5; pictureBox1.Top = (this.Height - pictureBox1.Height) / 2 - 40; label1.Top = pictureBox1.Top + pictureBox1.Height + 20; //检查网络,实际Loading label1.Text = "正在检查网络连接状态……"; label1.Left = (this.Width - label1.Width) / 2; new CheckInternet1(); }