H
hula
Hello
againe a "basic" question on UserControls.
I have some UserControls inside a panel.
Inside the controls i have checkboxes, comboboxes and textboxes.
On change of any data inside the control i like to save the actual done
change.
I can do this on the checkboxes or combos, by using the events provided
by the controls.
For the textbox this is a little more tricky (as it seems to me)
I don't want to use the "TextChanged" event, as this one is called on
every keypress. As i'm saving the chages to DB this would be... lets
say absurd.
I do save the changes on the "Leave" event therefore.
My problem comes if i close the parentwindow, where the pannel and
controls are embedded, prior of changeing the focus of the textbox
previously.
Any changes to the textbox are lost then.
I don't want so save the data in the destructor, as i can't rely on it
to be called before eg. the data is displayed againe (and of course the
wrong data if GC would not have deleted the object yet).
I also don't like to implement some "Save" function in the control that
i call on Unloading of the parent window for every UserControl inside
the panel (even though i will have to do this ...).
Can anyone give some hints?
_thanks in advance
againe a "basic" question on UserControls.
I have some UserControls inside a panel.
Inside the controls i have checkboxes, comboboxes and textboxes.
On change of any data inside the control i like to save the actual done
change.
I can do this on the checkboxes or combos, by using the events provided
by the controls.
For the textbox this is a little more tricky (as it seems to me)
I don't want to use the "TextChanged" event, as this one is called on
every keypress. As i'm saving the chages to DB this would be... lets
say absurd.
I do save the changes on the "Leave" event therefore.
My problem comes if i close the parentwindow, where the pannel and
controls are embedded, prior of changeing the focus of the textbox
previously.
Any changes to the textbox are lost then.
I don't want so save the data in the destructor, as i can't rely on it
to be called before eg. the data is displayed againe (and of course the
wrong data if GC would not have deleted the object yet).
I also don't like to implement some "Save" function in the control that
i call on Unloading of the parent window for every UserControl inside
the panel (even though i will have to do this ...).
Can anyone give some hints?
_thanks in advance