R
Romain TAILLANDIER
Hi group.
I have a strange problem that need a long explaination, sorry.
I have a form where i dynamically create lines (class Ligne : Panel ).
Lines are composed by
- a RadioButton, which is used to send a select event (to select the line).
- a red cross Button, wich used to send a delete event (to remove the line)
When i clic to the RadioButton, I send the SelectEvent
MainForm is listenning to it, and launch the select method.
When I clic the redCrossButton, I send the event SupprEvent.
MainForm is listenning to it, and launch the remove method.
The graphic interface is composed with 2 boutons that allow to dynamically
add a line; and dynamically remove the selected line.
So to Remove a line I have 2 ways :
- Clic on the red cross of a line (delete a selected or not selected line)
- Clic on the bouton Remove (delete the selected line)
Finally, the two way call for the same MainForm.RemoveLine method to remove
the line. One comming from the MainForm.RemoveBoutton_click method, the
other comming from the MainForm.ListernerForRemoveEvent method.
the MainForm.RemoveLine method call to Windows.Form.Controls.RemoveAt()
method.
And all seem to work fine.
But there is a difference. when i remove a line by clicking on the red cross
(MainForm.ListernerForRemoveEvent method) , the call to
Form.Controls.RemoveAt() cause a bug, that isn't caused when calling by the
clic on Remove button (MainForm.RemoveBoutton_click method). this bug is
that i can't anymore close the form by click in the top-rigth-corner-cross
of the form.
What i do, that i must not ??
So i think the problem is strange, and i create a minimalist application
that reproduce the bug. but it still remain a lot of necessary code. and
that code is documented in french
.
I am ok to send it if necessary.
For Gabriel G. Ponti,
sorry to make so much time for responding.
Thank you
ROM
I have a strange problem that need a long explaination, sorry.
I have a form where i dynamically create lines (class Ligne : Panel ).
Lines are composed by
- a RadioButton, which is used to send a select event (to select the line).
- a red cross Button, wich used to send a delete event (to remove the line)
When i clic to the RadioButton, I send the SelectEvent
MainForm is listenning to it, and launch the select method.
When I clic the redCrossButton, I send the event SupprEvent.
MainForm is listenning to it, and launch the remove method.
The graphic interface is composed with 2 boutons that allow to dynamically
add a line; and dynamically remove the selected line.
So to Remove a line I have 2 ways :
- Clic on the red cross of a line (delete a selected or not selected line)
- Clic on the bouton Remove (delete the selected line)
Finally, the two way call for the same MainForm.RemoveLine method to remove
the line. One comming from the MainForm.RemoveBoutton_click method, the
other comming from the MainForm.ListernerForRemoveEvent method.
the MainForm.RemoveLine method call to Windows.Form.Controls.RemoveAt()
method.
And all seem to work fine.
But there is a difference. when i remove a line by clicking on the red cross
(MainForm.ListernerForRemoveEvent method) , the call to
Form.Controls.RemoveAt() cause a bug, that isn't caused when calling by the
clic on Remove button (MainForm.RemoveBoutton_click method). this bug is
that i can't anymore close the form by click in the top-rigth-corner-cross
of the form.
What i do, that i must not ??
So i think the problem is strange, and i create a minimalist application
that reproduce the bug. but it still remain a lot of necessary code. and
that code is documented in french
.I am ok to send it if necessary.
For Gabriel G. Ponti,
sorry to make so much time for responding.

Thank you
ROM