How to cancel displayin a dialog form in the LOAD event

  • Thread starter Thread starter carloss
  • Start date Start date
C

carloss

Guest
Can someone provide a code example of how to cancel displaying a dialog/form while executing the form's LOAD event?

Thanks
 
I have already tried me.close() and me.dispose() and nothing returns the control to the calling form.
 
Here it is, and thanks for your time....

Private Sub OpenProjTask_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

If LoadProjects(psUserUnit, psUserTeam, psUserGroup) Then
If psLastProjectName <> "" Then
cbProj.Text = psLastProjectName
LoadTasks(plLastProjectNbr, psUserUnit, _
psUserTeam, psUserGroup)
End If
Else
MsgBox("The projects you participate in have no tasks assigned!", MsgBoxStyle.Critical)
Me.Close()
Me.Dispose()
End If
 
Back
Top