Пример #1
0
 public Form1()
 {
     InitializeComponent();
     ma = new Matriz2();
     loadStates();
     s = ma.matrixCombinatory();
 }
Пример #2
0
 /*
  * Evento click do botão zerar matriz.
  * Responsavel por apagar a matriz.
  *
  */
 private void btnZerar2_Click(object sender, EventArgs e)
 {
     Matriz2.zerarMatriz();
     Matriz2.Exibir(dgvMatriz2);
     setEnabled2(false);
     txtValor2.Text = "";
     qtdCol2.Value  = 0;
     qtdLi2.Value   = 0;
 }
Пример #3
0
 /*
  * Evento click do botão ler matriz:
  * Lê uma determinada matriz de um arquivo texto e exibe ele em um data grid view.
  *
  */
 private void btnLerMatriz2_Click(object sender, EventArgs e)
 {
     LerMatrizArquivo(ref Matriz2);
     if (Matriz2 != null)
     {
         Matriz2.Exibir(dgvMatriz2);
         qtdCol2.Maximum = Matriz2.QntColuna - 1;
         qtdLi2.Maximum  = Matriz2.QntLinha - 1;
         setEnabled2(true);
     }
 }
Пример #4
0
 /*
  * Evento click do botão somar valor.
  * Responsavel por somar um determinado valor em uma certa coluna na matriz
  *
  */
 private void btnSomarValor2_Click(object sender, EventArgs e)
 {
     if (txtValor2.Text != "" && double.TryParse(txtValor2.Text, out double valor))
     {
         Matriz2.SomarValorColuna(double.Parse(txtValor2.Text), int.Parse(qtdCol2.Value.ToString()));
         Matriz2.Exibir(dgvMatriz2);
     }
     else
     {
         MessageBox.Show("Campo valor nulo ou incorreto", "Erro", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Пример #5
0
 /*
  * Evento click do botão somar matrizes
  * Responsavel por procurar o valor de uma determinada celula pela linha e coluna.
  *
  */
 private void btnProcurar2_Click(object sender, EventArgs e)
 {
     txtValor2.Text = Matriz2.valorDe(int.Parse(qtdLi2.Value + ""), int.Parse(qtdCol2.Value + "")) + "";
 }
Пример #6
0
 /*
  * Evento click do botão excluir.
  * Responsavel por excluir uma determinada celula.
  *
  */
 private void btnExcluir2_Click(object sender, EventArgs e)
 {
     Matriz2.excluir(int.Parse(qtdLi2.Value.ToString()), int.Parse(qtdCol2.Value.ToString()));
     Matriz2.Exibir(dgvMatriz2);
     txtValor1.Text = "";
 }