StrataFrame Forum

Programmatically Displaying the Security Maintenance Dialog

http://forum.strataframe.net/Topic4178.aspx

By Charles Thomas Blankenship - 11/6/2006

I have created a main form named frmMain.  It contains one button cmdSecurityDialog.  Its code looks like this:

As soon as I press the button, a form with no content quickly shows and then disappears.  This happened both with the code as it is documented in the help topic as well as my trivial modification below (added a member variable to the form class to hole an instance of the form).  I initially thought it may be due to the VFP "problem" of a variable going out of scope.  But, alas, I don't think so as the behavior is equivalent in both incarnations.

Thanks again,

CT

Imports MicroFour.StrataFrame.Security

  Public Class frmMain

  Protected oDialog As SecurityDialog()

  Private Sub cmdSecurityDialog_Click(ByVal sender As System.Object, ByVal e As   System.EventArgs) Handles cmdSecurityDialog.Click

    Using oDialog As New SecurityDialog()

    oDialog.Show()

End Using

End Sub

End Class

 

By Trent L. Taylor - 11/6/2006

You are calling show().  If you want the dialog to stick around you either need to set the MDIParent property in the form or call the form as a modal dialog:

loForm.MDIParent = Me
loForm.Show

or

loFOrm.ShowDialog()

By Charles Thomas Blankenship - 11/6/2006

Well, so much for me paying attention to detail.BigGrin



Thanks,



CT