Results 1 to 6 of 6

Thread: Form Load

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Dec 2000
    Location
    Cairo, Egypt
    Posts
    126

    Angry

    Every time I call LoadPicture or the property PaintPicture in the sub Form_Load the picture doesn't appear at all. I make trace to find what happen the program go right and read without error and the picture doesn't appear.

  2. #2
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    Try

    Move it to the Form_Paint procedure
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  3. #3
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    use Form Activate

    In form load things are not loaded, they are loading ....
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  4. #4
    PowerPoster Chris's Avatar
    Join Date
    Jan 1999
    Location
    K-PAX
    Posts
    3,238
    I think put into the Form_Paint procedure is better. Since the Form_Activate will only fire when the Form is loaded. But the Form_Paint is a bit different from the

    Form_Activate. Whereby, when there is a change in the form windows, the Form_Paint event will be fire.

    regards,
    Chris

  5. #5
    Fanatic Member
    Join Date
    Sep 1999
    Location
    Bethel, North Carolina, USA
    Posts
    987
    Bobbo,

    I wouldn't suggest using LoadPicture in the Form_Paint event, else you will tie up alot of memory. I would do something like this...

    Code:
    Dim iPic As IPictureDisp
    
    Private Sub Form_Load()
     Set iPic = LoadPicture("C:\Windows\Bubbles.bmp") ' Load the picture
    End Sub
    
    Private Sub Form_Paint()
     Me.PaintPicture iPic, 0, 0 ' Show the picture
    End Sub
    
    Private Sub Form_Unload(Cancel As Integer)
     Set iPic = Nothing 'free memory
    End Sub
    Also just to clarify the Form_Activate is fired every time the form regains the focus, not just when the form is loaded.
    {Insert random techno-babble here}

    {Insert quote from some long gone mofo here}

  6. #6
    Guest
    Not sure if it'll help, but you may want to set the Form's AutoRedraw property to True.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width