Can't do this in form1_load. What's the next best option?

  • Thread starter Thread starter shawncraig
  • Start date Start date
S

shawncraig

Since the ShowDialog() doesn't allow the frmGreyOut finish loading.
The cool greyed out effect is never seen. Just the popup called
frmYesNo

Private Sub frmGreyOut_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
My.Forms.frmYesNo.Message = pstrMessage
My.Forms.frmYesNo.ShowDialog()
Me.DialogResult = My.Forms.frmYesNo.DialogResult
End Sub

In VB6 we had to use a timer to get around this crap.... someone
PLEASE tell me the MS has given us a better way besides using a timer?
 
Im not sure i am understanding your issue correctly, but maybe using the
Form_Shown event might help?

If not then, explain in a little more detail what you are trying to do...
 
Since the ShowDialog() doesn't allow the frmGreyOut finish loading.
The cool greyed out effect is never seen. Just the popup called
frmYesNo

Private Sub frmGreyOut_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
My.Forms.frmYesNo.Message = pstrMessage
My.Forms.frmYesNo.ShowDialog()
Me.DialogResult = My.Forms.frmYesNo.DialogResult
End Sub

In VB6 we had to use a timer to get around this crap.... someone
PLEASE tell me the MS has given us a better way besides using a
timer?


Why do you want to hide frmGreyout behind frmYesNo immediatelly after
showing it?

Is frmGreyOut shown modally? If it is not, I would change the calling code:

1. Show frmGreyout
2. Show frmYesNo modally



Armin
 
I have run into the same thin in vb.net and i do the same thing..

I load thestuff after a timer 1 second event.

I think its silly and i cant figure out how others have done this - or why
they dont run into the same issues.
 
Back
Top