private void Accounts_UC_MouseClick(object sender, MouseEventArgs e) { AccNoTextField.Text = ""; TypeTextField.Text = ""; BalTextField.Text = ""; SearchAccTextField.Text = ""; StatusLabel.Hide(); accountDatagridview(); }
private void Banks_UC_MouseClick(object sender, MouseEventArgs e) { IDTextField.Text = ""; NameTextField.Text = ""; AddressTextField.Text = ""; SearchIDTextField.Text = ""; StatusLabel.Hide(); bankDatagridview(); }
private void Customers_UC_MouseClick(object sender, MouseEventArgs e) { StatusLabel.Hide(); CustIDTextField.Text = ""; CustNameTextField.Text = ""; PhoneTextField.Text = ""; AddressTextField.Text = ""; SearchCustIDTextField.Text = ""; customerDatagridview(); }
private void Loans_UC_MouseClick(object sender, MouseEventArgs e) { StatusLabel.Hide(); LoanNoTextField.Text = ""; AmtTextField.Text = ""; BranchNoTextfield.Text = ""; TypeTextField.Text = ""; CustIdTextField.Text = ""; loanDatagridview(); }
private void Reinstall_Click(object sender, EventArgs e) { if (UserPreferences.Current.ShouldUseBetaPath) { UserPreferences.Current.ResetBetaSourceDirectory(); } StatusLabel.Hide(); installedModsView.Hide(); installedModsTitle.Hide(); InstallButton.Hide(); CloseButton.Hide(); Reinstall.Hide(); modBotSettingsButton.Hide(); LocalVersionLabel.Hide(); LatestVersionLabel.Hide(); ProgressBar.Show(); installingModBotLabel.Show(); ModBotInstallerManager.ProgressBar = ProgressBar; ModBotInstallerManager.Install(UserPreferences.Current.GameInstallationDirectory, OnInstallFinished); }
private void InstallButton_Click(object sender, EventArgs e) { if ((_installationState != ModBotInstallationState.UpToDate && _installationState != ModBotInstallationState.BetaVersion) || UserPreferences.Current.ShouldUseBetaPath) { StatusLabel.Hide(); installedModsView.Hide(); installedModsTitle.Hide(); InstallButton.Hide(); CloseButton.Hide(); Reinstall.Hide(); modBotSettingsButton.Hide(); LocalVersionLabel.Hide(); LatestVersionLabel.Hide(); ProgressBar.Show(); installingModBotLabel.Show(); ModBotInstallerManager.ProgressBar = ProgressBar; ModBotInstallerManager.Install(UserPreferences.Current.GameInstallationDirectory, OnInstallFinished); } else { StartGameAndExit(); } }
public void RefreshText() { StatusLabel.Hide(); int wordsCount = Program.TextTable.GetLength(0); if (wordsCount == 0) { return; } Label[] words = new Label[wordsCount]; int[,] rawMap = new int[wordsCount + 1, 2]; //rawMap[i, 0]: the index of first word in raw i, rawMap[i, 1]: the width of this raw Graphics g = TextPanel.CreateGraphics(); //for counting the text size int maxWordHeight = 0; int raw = 0; //count of raws for (int i = 0; i < wordsCount; i++) { //generate new word labels words[i] = new Label(); words[i].AutoSize = false; words[i].Text = Program.TextTable[i, 0]; words[i].Font = WordsFont; words[i].TextAlign = ContentAlignment.MiddleCenter; words[i].ForeColor = Color.White; SizeF sizeF = g.MeasureString(words[i].Text, WordsFont); words[i].Size = new Size((int)Math.Ceiling(sizeF.Width) + 4, words[i].Height); //make ample width maxWordHeight = Math.Max(maxWordHeight, (int)Math.Ceiling(sizeF.Height)); //will be set after //group the words by property if (!PropertyFilter.Contains(Program.TextTable[i, 1])) { words[i].MouseEnter += (object o, EventArgs ea) => { ((Label)o).BackColor = BackColorDefault; }; words[i].MouseLeave += (object o, EventArgs ea) => { ((Label)o).BackColor = BackColorEmpha; }; words[i].MouseHover += ShowDic; words[i].MouseLeave += HideDic; words[i].BackColor = BackColorEmpha; } else { words[i].BackColor = BackColorDefault; } //divide raws if (rawMap[raw, 1] + words[i].Width > TextPanel.Width) { if (rawMap[raw, 0] > 1) { rawMap[raw, 1] -= WordsMargin; } rawMap[++raw, 0] = i; } rawMap[raw, 1] += words[i].Width + WordsMargin; } g.Dispose(); //set all the height to the max for (int i = 0; i < wordsCount; i++) { words[i].Size = new Size(words[i].Width, maxWordHeight); } //allocate to different raws and set position rawMap[raw + 1, 0] = wordsCount; //boundary condition for (int r = 0; r <= raw; r++) { words[rawMap[r, 0]].Location = new Point(Math.Max((TextPanel.Width - rawMap[r, 1]) / 2, 0), (maxWordHeight + WordsRawMargin) * r); for (int i = rawMap[r, 0] + 1; i < rawMap[r + 1, 0]; i++) { words[i].Location = new Point(words[i - 1].Location.X + words[i - 1].Width + WordsMargin, words[i - 1].Location.Y); } } //set the index for easily finding TextPanel.Controls.AddRange(words); for (int i = 0; i < wordsCount; i++) { TextPanel.Controls.SetChildIndex(words[i], i); } TextPanel.Height = maxWordHeight * (raw + 1) + WordsRawMargin * raw; }