[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.axapta.programming

modified event on modification of combo control

Ashish

12/12/2005 8:57:00 AM

Hi All,

can anyone explain me why in case of combobox modified event is called twice
firstly on modifying the control and secondly on closing that form which
consist that control.
I have a requirement in which I have to print a message on modification of
the combo control but the message prints twice on modification and on closing
that form.I did the requirement through setting the flag.
does anybody have any idea to print the message only once(i.e. on
modification only) otherthan setting flags.


1 Answer

Anish Abslom

12/13/2005 6:35:00 AM

0

Hi,

In case of combobox modified event It would be triggered twice firstly on
modifying the control and secondly on closing of the form which has that
control. This is due to following series of events

On modification following events are triggered

1. ComboBox:DataSource1_ENUMTYPE\Methods >> SelectionChange

2. Classes\FormComboBoxControl\SelectionChange

3. ComboBox:DataSource1_ENUMTYPE\Methods >> modified

On Closing of the form following events are triggered

1. Classes\FormRun\canClose

2. Classes\FormRun\selectControl

3. Classes\FormComboBoxControl\leave

4. ComboBox:DataSource1_ENUMTYPE\Methods >> modified

So on the both cases modified event is being triggered

To make printing happen only once, i.e. on the modification of the combo box
it would be appropriate to restrict your print code in the selectionchange
method

(ComboBox:DataSource1_ENUMTYPE\Methods >> SelectionChange)

Hope this will solve the issue â?¦.