mathieu_cupryk
asked on
Given the following diagram if one of the controls change enable save button.
How can I enable save button if one of the controls changes. See attached file.
enablesavebutton.jpg
enablesavebutton.jpg
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
private void Form1_Load(object sender, EventArgs e)
{
sbPnlMsg.Text = "";
LoadInitialPriceReporting( );
BuildStatBar();
HideTabs();
EnableSaveButton();
}
private void EnableSaveButton()
{
rbtnInitialPriceOption.Che ckedChange d += new EventHandler(CheckedChange d);
rbtnAdjustmentPriceOption. CheckedCha nged += new EventHandler(CheckedChange d);
rbtnInterimPaymentOption.C heckedChan ged += new EventHandler(CheckedChange d);
rbtnFinalPaymentOption.Che ckedChange d += new EventHandler(CheckedChange d);
chkboxBarley.CheckedChange d += new EventHandler(CheckedChange d);
chkboxDesBarley.CheckedCha nged += new EventHandler(CheckedChange d);
chkboxDurum.CheckedChanged += new EventHandler(CheckedChange d);
chkboxWheat.CheckedChanged += new EventHandler(CheckedChange d);
}
{
sbPnlMsg.Text = "";
LoadInitialPriceReporting(
BuildStatBar();
HideTabs();
EnableSaveButton();
}
private void EnableSaveButton()
{
rbtnInitialPriceOption.Che
rbtnAdjustmentPriceOption.
rbtnInterimPaymentOption.C
rbtnFinalPaymentOption.Che
chkboxBarley.CheckedChange
chkboxDesBarley.CheckedCha
chkboxDurum.CheckedChanged
chkboxWheat.CheckedChanged
}
Hi,
for the textbox you use the textchanged event:
textBox1.TextChanged += new EventHandler(CheckedChange d);
for the textbox you use the textchanged event:
textBox1.TextChanged += new EventHandler(CheckedChange
ASKER
cool.
ASKER
private bool onLoad = true;
public Form1()
{
InitializeComponent();
BuildStatBar();
EnableSaveButton();
}
private void EnableSaveButton()
{
rbtnInitialPriceOption.Che
rbtnAdjustmentPriceOption.
rbtnInterimPaymentOption.C
rbtnFinalPaymentOption.Che
chkboxBarley.CheckedChange
chkboxDesBarley.CheckedCha
chkboxDurum.CheckedChanged
chkboxWheat.CheckedChanged
}
protected override void OnActivated(EventArgs e)
{
onLoad = false;
}
private void CheckedChanged(object sender, EventArgs e)
{
if (!onLoad)
{
Control c = (Control)sender;
if (c.Focused)
{
MessageBox.Show("Changed")
}
}
}
I have not tested it yet but we need to check if the person the txtListName has changed?