PDA

Click to See Complete Forum and Search --> : Picture boxes


catherine
Feb 6th, 2001, 03:47 PM
Hoping you can help me out on this one!!!!!
I have drawn a graph on one form (frmnodes) & when the form is unloaded during run time I want that picture (picbox) to automatically come up on my startup form (frmanalyse). This should be a simple matter of loading it but I can't quite manage it.
Any help is much appreciated!!!!!

Arcom
Feb 6th, 2001, 04:46 PM
You need to set the AutoRedraw property of frmNodes to TRUE, then put this code in frmNode:

Private Sub Form_Unload()

' Load the startup form
frmAnalyse.Show

' Copy the form's picture to a PictureBox located on startup form
Set frmAnalyse.picBox.Picture = Me.Image

' Clean up
Set frmNode = Nothing

End Sub


This should do the trick, although I'm not running VB, and therefore cannot check if this code will work properly. Anyway, if this fails, try putting the "frmAnalyse..." and "Set frmAnalyse.picBox..." lines in Form_QueryUnload event.

Hope this is what you wanted!