コード例 #1
0
        private void cboServico_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (cboServico.Text.Equals("Venda"))
            {
                // Carrega o combobox de Produtos
                cboProdutos.DataSource = pagamentoRepository.PopulaProduto();

                // ---------------------- TRECHO RESPONSÁVEL POR POSICIONAR OS ELEMENTOS NA POSIÇÃO CORRETA DE ACORDO COM O SERVIÇO SELECIONADO
                // VISIBLE

                cboProdutos.Visible = true;
                txtQntd.Visible     = true;
                lblProduto.Visible  = true;
                lblQntd.Visible     = true;

                // SIZE

                groupBox1.Height = 441;
                groupBox1.Width  = 765;

                listViewServicos.Height = 488;
                listViewServicos.Width  = 371;

                this.Height = 592;
                this.Width  = 1218;

                panel1.Height = 592;
                panel1.Width  = 799;

                // LOCATION

                lblValor.Location      = new Point(515, 347);
                txtValor.Location      = new Point(519, 364);
                lblTextoTroco.Location = new Point(514, 394);
                lblValorTroco.Location = new Point(591, 394);

                cboDesconto.Location = new Point(23, 364);
                ckbDesconto.Location = new Point(23, 339);

                lblRecebido.Location = new Point(21, 277);
                txtRecebido.Location = new Point(25, 298);

                lblForma.Location          = new Point(266, 277);
                cboFormaPagamento.Location = new Point(269, 298);

                btnSalvar.Location           = new Point(47, 477);
                btnAdicionarNaLista.Location = new Point(230, 477);
                btnLimpar.Location           = new Point(486, 364);
                btnReagendar.Location        = new Point(413, 477);
                btnCancelar.Location         = new Point(596, 477);
            }
            else
            {
                // VISIBLE

                cboProdutos.Visible = false;
                txtQntd.Visible     = false;
                lblProduto.Visible  = false;
                lblQntd.Visible     = false;

                // SIZE

                groupBox1.Height = 375;
                groupBox1.Width  = 765;

                panel1.Height = 477;
                panel1.Width  = 799;

                listViewServicos.Height = 434;
                listViewServicos.Width  = 371;

                this.Height = 541;
                this.Width  = 1218;

                // LOCATION
                lblValor.Location      = new Point(515, 278);
                txtValor.Location      = new Point(519, 297);
                lblTextoTroco.Location = new Point(514, 337);
                lblValorTroco.Location = new Point(591, 337);

                cboDesconto.Location = new Point(23, 297);
                ckbDesconto.Location = new Point(23, 272);

                txtRecebido.Location = new Point(25, 230);
                lblRecebido.Location = new Point(21, 211);

                lblForma.Location          = new Point(265, 212);
                cboFormaPagamento.Location = new Point(268, 230);

                btnSalvar.Location           = new Point(47, 421);
                btnAdicionarNaLista.Location = new Point(230, 421);
                btnLimpar.Location           = new Point(486, 297);
                btnReagendar.Location        = new Point(413, 421);
                btnCancelar.Location         = new Point(596, 421);
            }
        }