public InformationForm() { _Form = this; InitializeComponent(); // バッテリーの有無 if ((SystemInformation.PowerStatus.BatteryChargeStatus & BatteryChargeStatus.NoSystemBattery) == BatteryChargeStatus.NoSystemBattery) { Properties.Settings.Default.Battery = false; } else { Microsoft.Win32.SystemEvents.PowerModeChanged += SystemEvents_PowerModeChanged; this._BatteryClock.Start(); } this._ClockTimer.Start(); this.label1.Width = 260; this.label1.Height = 22; this.label2.Width = 260; this.label2.Height = 22; bool _AstClock = Properties.Settings.Default.AstClock; bool _Battery = Properties.Settings.Default.Battery; // 幅と表示位置 if (_AstClock && _Battery) { this.Width = 560; label1.Location = new Point(12, 9); label2.Location = new Point(this.Width / 2, 9); } else { this.Width = 280; if (_AstClock) { label1.Location = new Point(12, 9); label2.Location = new Point(-200, -200); } else { label1.Location = new Point(-200, -200); label2.Location = new Point(this.Width / 2, 9); } } this.Location = new Point(Screen.PrimaryScreen.Bounds.Width / 2 - this.Width / 2, Screen.PrimaryScreen.WorkingArea.Top); }
public vGamePadForm(ref DeviceControl devCon) { InitializeComponent(); this.Width = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width; int baseWidth = this.ClientSize.Width; // 786 m_devCon = devCon; m_cmdLine = Environment.ExpandEnvironmentVariables("%ProgramFiles%") + "\\Common Files\\microsoft shared\\ink\\TabTip.exe"; m_barrageArray[0] = new vBarrageButton(ref devCon, this, 0); m_barrageArray[0].m_image_off = Properties.Resources._01_0; m_barrageArray[0].m_image_on = Properties.Resources._01_1; m_barrageArray[0].m_image_Barrage = Properties.Resources._01_2; m_barrageArray[1] = new vBarrageButton(ref devCon, this, 1); m_barrageArray[1].m_image_off = Properties.Resources._02_0; m_barrageArray[1].m_image_on = Properties.Resources._02_1; m_barrageArray[1].m_image_Barrage = Properties.Resources._02_2; m_barrageArray[2] = new vBarrageButton(ref devCon, this, 2); m_barrageArray[2].m_image_off = Properties.Resources._03_0; m_barrageArray[2].m_image_on = Properties.Resources._03_1; m_barrageArray[2].m_image_Barrage = Properties.Resources._03_2; m_barrageArray[3] = new vBarrageButton(ref devCon, this, 3); m_barrageArray[3].m_image_off = Properties.Resources._04_0; m_barrageArray[3].m_image_on = Properties.Resources._04_1; m_barrageArray[3].m_image_Barrage = Properties.Resources._04_2; m_buttonArray[0] = new vButton(); m_buttonArray[0].m_image_off = Properties.Resources._05_0; m_buttonArray[0].m_image_on = Properties.Resources._05_1; m_buttonArray[1] = new vButton(); m_buttonArray[1].m_image_off = Properties.Resources._06_0; m_buttonArray[1].m_image_on = Properties.Resources._06_1; m_buttonArray[2] = new vButton(); m_buttonArray[2].m_image_off = Properties.Resources._07_0; m_buttonArray[2].m_image_on = Properties.Resources._07_1; m_buttonArray[3] = new vButton(); m_buttonArray[3].m_image_off = Properties.Resources._08_0; m_buttonArray[3].m_image_on = Properties.Resources._08_1; m_buttonArray[4] = new vButton(); m_buttonArray[4].m_image_off = Properties.Resources._09_0; m_buttonArray[4].m_image_on = Properties.Resources._09_1; m_buttonArray[5] = new vButton(); m_buttonArray[5].m_image_off = Properties.Resources._10_0; m_buttonArray[5].m_image_on = Properties.Resources._10_1; m_buttonArray[6] = new vButton(); m_buttonArray[6].m_image_off = Properties.Resources._11_0; m_buttonArray[6].m_image_on = Properties.Resources._11_1; m_buttonArray[7] = new vButton(); m_buttonArray[7].m_image_off = Properties.Resources._12_0; m_buttonArray[7].m_image_on = Properties.Resources._12_1; m_crossArray[0] = new vButton(); m_crossArray[0].m_image_off = Properties.Resources.up_0; m_crossArray[0].m_image_on = Properties.Resources.up_1; m_crossArray[1] = new vButton(); m_crossArray[1].m_image_off = Properties.Resources.right_0; m_crossArray[1].m_image_on = Properties.Resources.right_1; m_crossArray[2] = new vButton(); m_crossArray[2].m_image_off = Properties.Resources.down_0; m_crossArray[2].m_image_on = Properties.Resources.down_1; m_crossArray[3] = new vButton(); m_crossArray[3].m_image_off = Properties.Resources.left_0; m_crossArray[3].m_image_on = Properties.Resources.left_1; m_stickArray[0] = new vStick(); m_stickArray[0].m_image_off = Properties.Resources.stick_b_0; m_stickArray[0].m_image_on = Properties.Resources.stick_b_1; m_stickArray[1] = new vStick(); m_stickArray[1].m_image_off = Properties.Resources.stick_b_0; m_stickArray[1].m_image_on = Properties.Resources.stick_b_1; m_soundState = new vButton(); m_soundState.m_image_off = Properties.Resources.memo_1; m_soundState.m_image_on = Properties.Resources.memo_2; m_softKeyboard = new vButton(); m_softKeyboard.m_image_off = Properties.Resources.Keyboard; m_softKeyboard.m_image_on = Properties.Resources.Keybord_ON; m_devCon.MoveStick(0, 50, 50); m_devCon.MoveStick(1, 50, 50); this.Button1 = new System.Windows.Forms.Button(); this.Button1.Name = "button1"; this.Button1.Size = new System.Drawing.Size(44, 22); this.Button1.Text = ""; this.Button1.BackColor = System.Drawing.Color.Red; this.Button2 = new System.Windows.Forms.Button(); this.Button2.Name = "button2"; this.Button2.Size = new System.Drawing.Size(22, 22); this.Button2.Text = ""; this.Button2.BackColor = System.Drawing.Color.Red; this.Button1.MouseDown += Button1_MouseDown; this.Button1.MouseMove += Button1_MouseMove; this.Button1.MouseUp += Button1_MouseUp; this.Button2.Click += Button2_Click; OnDisplayChange(Screen.PrimaryScreen.Bounds.Width, 0); SetRegion(Properties.Settings.Default.Skeleton); this.Controls.Add(this.Button1); this.Controls.Add(this.Button2); m_ConfigForm = new ConfigrationForm(); m_ConfigForm.Show(); m_InfotmationForm = new InformationForm(); _Form = this; try { System.Diagnostics.Process hProc = null; hProc = System.Diagnostics.Process.Start(_memoCmd); hProc.Close(); } catch { } }
private void InformationForm_FormClosed(object sender, FormClosedEventArgs e) { _Form = null; }