private void buttonInputFileB_Click(object sender, EventArgs e) { try { GlobalsMatrix.docketqua("B"); if (GlobalsMatrix.RowB > 50 || GlobalsMatrix.ColB > 50) { RowB = GlobalsMatrix.RowB; ColB = GlobalsMatrix.RowB; MatrixName = "B"; MyMessageBox.Show("Đã thêm ma trận B, do ma trận có kích thước lớn vui lòng nhập số dòng/cột rồi nhấn nút show để xem chi tiết"); textBoxColB.Text = "" + GlobalsMatrix.ColB; textBoxRowB.Text = "" + GlobalsMatrix.RowB; } else { MyMessageBox.Show("Dòng hoặc cột nhỏ hơn hoặc bằng 50, vui lòng sử dụng chức năng Matrix's smaller than 50x50"); } } catch (Exception ex) { MyMessageBox.Show(ex.Message); } }
private void buttonInputFileB_Click(object sender, EventArgs e) { try { GlobalsMatrix.docketqua("B"); if (GlobalsMatrix.RowB <= 50 && GlobalsMatrix.ColB <= 50) { //Nếu Ma Trận chưa được khởi tạo -> Tạo mới Ma Trận if (RowB == 0 && ColB == 0) { RowB = GlobalsMatrix.RowB; ColB = GlobalsMatrix.RowB; MatrixName = "B"; Add_MatrixRead(); textBoxColB.Text = "" + GlobalsMatrix.ColB; textBoxRowB.Text = "" + GlobalsMatrix.RowB; } //Nếu muốn tạo ra ma trận ngẫu nhiên khác else if (GlobalsMatrix.RowB == RowB && GlobalsMatrix.ColB == ColB) { MatrixName = "B"; RowB = GlobalsMatrix.RowB; ColB = GlobalsMatrix.RowB; Refresh_MatrixRead(); textBoxColB.Text = "" + GlobalsMatrix.ColB; textBoxRowB.Text = "" + GlobalsMatrix.RowB; } //Trường hợp còn lại else { MatrixName = "B"; Delete_MatrixRead(); RowB = GlobalsMatrix.RowB; ColB = GlobalsMatrix.RowB; Add_MatrixRead(); textBoxColB.Text = "" + GlobalsMatrix.ColB; textBoxRowB.Text = "" + GlobalsMatrix.RowB; } } else { MyMessageBox.Show("Dòng hoặc cột lớn hơn 50, vui lòng sử dụng chức năng Matrix's bigger than 50x50"); } } catch (Exception ex) { MyMessageBox.Show(ex.Message); } }