Exemplo n.º 1
0
        private void InicializeBotoes(EnumTipoDeForm tipoDeForm)
        {
            switch (tipoDeForm)
            {
            case EnumTipoDeForm.Cadastro:
                btnCancelarExcluir.Enabled = false;
                btnCancelarExcluir.Visible = false;

                txtLineQuantidadeEstoque.Enabled = false;
                txtQuantidadeEmEstoque.Enabled   = false;

                btnEditarSalvar.Image    = Properties.Resources.floppy_icon;
                _switchBotaoEditarSalvar = EnumBotoesForm.Salvar;
                break;

            case EnumTipoDeForm.Edicao:
                btnCancelarExcluir.Enabled  = true;
                btnCancelarExcluir.Visible  = true;
                btnCancelarExcluir.Image    = Properties.Resources.cancel_icon;
                _switchBotaoCancelarExcluir = EnumBotoesForm.Cancelar;

                btnEditarSalvar.Image    = Properties.Resources.floppy_icon;
                _switchBotaoEditarSalvar = EnumBotoesForm.Salvar;

                txtLineQuantidadeEstoque.Enabled = true;
                txtQuantidadeEmEstoque.Enabled   = true;

                break;

            case EnumTipoDeForm.Detalhamento:
                btnCancelarExcluir.Enabled  = true;
                btnCancelarExcluir.Visible  = true;
                btnCancelarExcluir.Image    = Properties.Resources.delete;
                _switchBotaoCancelarExcluir = EnumBotoesForm.Excluir;

                btnEditarSalvar.Image    = Properties.Resources.edit_512;
                _switchBotaoEditarSalvar = EnumBotoesForm.Editar;
                break;
            }

            btnEditarSalvar.Refresh();
            btnCancelarExcluir.Refresh();
        }
Exemplo n.º 2
0
        protected void InicializeBotoes(EnumTipoDeForm tipoDeForm,
                                        ref PictureBox btnEditarSalvar,
                                        ref PictureBox btnCancelarExcluir,
                                        ref EnumBotoesForm switchBotaoEditarSalvar,
                                        ref EnumBotoesForm switchBotaoCancelarExcluir)
        {
            switch (tipoDeForm)
            {
            case EnumTipoDeForm.Cadastro:
                btnCancelarExcluir.Enabled = false;
                btnCancelarExcluir.Visible = false;

                btnEditarSalvar.Image   = Properties.Resources.floppy_icon;
                switchBotaoEditarSalvar = EnumBotoesForm.Salvar;
                break;

            case EnumTipoDeForm.Edicao:
                btnCancelarExcluir.Enabled = true;
                btnCancelarExcluir.Visible = true;
                btnCancelarExcluir.Image   = Properties.Resources.cancel_icon;
                switchBotaoCancelarExcluir = EnumBotoesForm.Cancelar;

                btnEditarSalvar.Image   = Properties.Resources.floppy_icon;
                switchBotaoEditarSalvar = EnumBotoesForm.Salvar;
                break;

            case EnumTipoDeForm.Detalhamento:
                btnCancelarExcluir.Enabled = true;
                btnCancelarExcluir.Visible = true;
                btnCancelarExcluir.Image   = Properties.Resources.delete;
                switchBotaoCancelarExcluir = EnumBotoesForm.Excluir;

                btnEditarSalvar.Image   = Properties.Resources.edit_512;
                switchBotaoEditarSalvar = EnumBotoesForm.Editar;
                break;
            }

            btnEditarSalvar.Refresh();
            btnCancelarExcluir.Refresh();
        }