How to disable combo box on first form by clicking save on the second form
I would like to disable the combo box which was in the first Form on clicking save on the second Form.
I am having 2 forms and my requirement is to append the 2 forms data together this was done
For my requirement i write a small code but it doesn't work for me
My code is as follows
Form1 i write my code as follows
public void loadingDatafrom(bool str)
{
if (true)
{
开发者_如何学编程 cmbServiceClassCode.Enabled = false;
}
else
{
cmbServiceClassCode.Enabled = true;
}
}
Form2 after save and hiding the form2 i call the above method
frmBatch frmbatch = new frmBatch(frmmain);
frmbatch.loadingDatafrom(true);
But this is not working any help please.
I'm not sure to understand your question. From your main form FrmBatch, Call the 2nd form FrmEntry in modal mode. After you Save and close FrmEntry form, you have to disabled combox box. In FrmBatch call this :
Form2 FrmEntry = new Form2();
FrmEntry.ShowDialog();
cmbServiceClassCode.Enabled = false;
The first thing to fix is
-> if (true)
if (str)
精彩评论