Form gets closed when clicked on the form area, C# Windows app

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • fastestindian
    New Member
    • Aug 2009
    • 74

    Form gets closed when clicked on the form area, C# Windows app

    Hi,

    I m working on a Windows application when I am opening a Windows form on change of date control on parent form.
    I am opening that windows form using ShowDialog(). On that form there are 3 countrols, 2 are Infragistics combobox and 1 is User control. When I select a combobox, it opens a drop down but instead selecting the value in the dropdown I click on the form area. It calls the form_Closing method.

    I m not sure why it is happening as I need the value on the form to be returned to parent form.

    Can anyone tell me why my form is getting closed???

    Thanks in advance.
  • fastestindian
    New Member
    • Aug 2009
    • 74

    #2
    I got this resolved when I added Parent object as parameter while calling ShowDialog() method.

    example: obj.ShowDialog( this);

    Comment

    Working...