Results 1 to 3 of 3

Thread: change forms icon [resolved]

  1. #1

    Thread Starter
    Lively Member vb_paladin's Avatar
    Join Date
    May 2003
    Location
    USA
    Posts
    102

    change forms icon [resolved]

    How can I change my form's icon during runtime?
    Last edited by vb_paladin; Feb 21st, 2004 at 06:36 PM.

  2. #2
    Only Slightly Obsessive jemidiah's Avatar
    Join Date
    Apr 2002
    Posts
    2,431
    Form1.Icon = [some StdPicture or lPictureDisp object]

    Ex: Form1.Icon = LoadPicture("C:\MyPic.jpg") or
    Form1.Icon = Picture1.Picture or
    Form1.Icon = Image1.Picture

    The LoadPicture method loads a picture from the harddrive.
    Picture1 is a PictureBox.
    Image1 is an ImageBox.

    Hope that helps.
    The time you enjoy wasting is not wasted time.
    Bertrand Russell

    <- Remember to rate posts you find helpful.

  3. #3
    PowerPoster Keithuk's Avatar
    Join Date
    Jan 2004
    Location
    Staffordshire, England
    Posts
    2,236
    You can't use Form1.Icon = LoadPicture("C:\MyPic.jpg") it has to be an Icon(ico) or Cursor(cur). Plus if the file got deleted or renamed then this would cause an error.

    The easiest thing to do is load a few icons in an imgIcon(6) array on the form and make them invisible. Then on Form Load sort the form icon randomly.

    How ever many icons you load.
    Form1.Icon = imgIcon(Int((6 * Rnd) + 1)).Picture

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