0
I’m having trouble loading a menu through another screen follows my code below. What would be a possible solution, for such error?
public partial class frmMenu : Form
{
public frmMenu()
{
InitializeComponent();
}
private void guichesToolStripMenuItem_Click(object sender, EventArgs e)
{
frmCadastroGuiche frm = new frmCadastroGuiche();
frm.ShowDialog();
}
}
Screen that should be loaded when clicking the Guiche button.
public partial class frmCadastroGuiche : Form
{
public frmCadastroGuiche()
{
carregarCombos();
carregando = true;
carregargrid();
carregando = false;
InitializeComponent();
}
bool pularFiltro = false;
bool carregando = false;
public bool setDatabase(Sele.Classes.clsDatabase oDB)
{
try
{
oAtende.oDB = oDB;
carregarCombos();
carregando = true;
carregargrid();
carregando = false;
return true;
}
catch (Exception)
{
return false;
}
}
DataTable dtGuiche = new DataTable();
public void carregarCombos()
{
lstTipoSenha_id.DataSource = oAtende.dtTipoSenha;
oAtende.dtTipoSenha = oAtende.getSenhaTipo();
lstTipoSenha_id.DisplayMember = "Tipo da Senha";
lstTipoSenha_id.ValueMember = "id";
lstTipoSenha_id.DataSource = oAtende.dtTipoSenha;
}
private void carregargrid()
{
carregando = true;
dg.CurrentCell = null;
dg.AutoGenerateColumns = false;
dtGuiche = oAtende.getGuiches("");
dg.DataSource = dtGuiche.DefaultView;
dg.CurrentCell = null;
dg.ClearSelection();
carregando = false;
}
}
below this would have the codes of save and delete buttons in the fields that were passed, but I did not put because I did not find it necessary I believe that the error is not there.
What’s the matter?
– Jéf Bueno
This screen frmMenu I can load the screen frmRelatories(I did not put the code), but when I try to call the screen frmCadastroGuiche the button happens nothing, the compiler does not report any error.
– Gabriel Correia