public Form1(string langName) { mLangName = langName; InitializeComponent(); mEnlarging = false; mPausing = false; mScreenPictureBox.ClientSize = new System.Drawing.Size(0, 0); mScreenPictureBox.BackColor = Color.Green; //TODO:デバグ用 mScreenPictureBox.ForeColor = Color.Red; //TODO:デバグ用 mSunabaSystem = new SunabaLib.SunabaSystem(this.Handle, mLangName); mSunabaSystem.setPictureBoxHandle(mScreenPictureBox.Handle, mWidth * mScale, mHeight * mScale); mScreenPictureBox.Refresh(); mKeys = new sbyte[(int)SunabaLib.SunabaSystem.Key.KEY_COUNT]; //言語ごとにボタンのテキストを変更 if (mLangName == "chinese") { mRebootButton.Text = "重启"; mEnlargeButton.Text = "放大/缩小"; } else if (mLangName == "korean") { mRebootButton.Text = "재시작"; mEnlargeButton.Text = "확대/축소"; } }
private void resize() { mEnlarging = true; //ピクチャボックスのサイズを変更 mScreenPictureBox.ClientSize = new System.Drawing.Size( mWidth * mScale, mHeight * mScale); //フォームのサイズを、ピクチャボックスの右端、下端、メッセージの下端を元に設定 int scEndX = mScreenPictureBox.Size.Width + mScreenPictureBox.Location.X; int scEndY = mScreenPictureBox.Size.Height + mScreenPictureBox.Location.Y; int mesEndY = mMessageWindowTextBox.Size.Height + mMessageWindowTextBox.Location.Y; int newCW = scEndX; int newCH = (scEndY > mesEndY) ? scEndY : mesEndY; this.Size = this.SizeFromClientSize(new Size(newCW + 12, newCH + 12)); //メッセージボックスの高さを微調整 int newMesEndY = this.ClientSize.Height - 12; int diffY = newMesEndY - mesEndY; Size oldMesSize = mMessageWindowTextBox.Size; mMessageWindowTextBox.Size = new Size(oldMesSize.Width, oldMesSize.Height + diffY); mEnlarging = false; mSunabaSystem.setPictureBoxHandle(mScreenPictureBox.Handle, mWidth * mScale, mHeight * mScale); mScreenPictureBox.Refresh(); }