Results 1 to 8 of 8

Thread: Images

  1. #1

    Thread Starter
    Lively Member Smarturtle's Avatar
    Join Date
    Nov 2001
    Location
    INFINITE LOOP
    Posts
    103

    Images

    Hey i have a whole bunch of images that i would like to include in my project. Is there a way that when a person clicks a button an image apears in the middle of the form... for each button they press. so that each image over laps the next. With out writing a whole bucnh of .show or .visible code?


    thanks
    •º£ëÖº•

    ____________________________
    If you run alot no matter if you like to or not, it grows on you.... Visual basic has yet to grow on me!

  2. #2
    The picture isn't missing BuggyProgrammer's Avatar
    Join Date
    Oct 2000
    Location
    Vancouver, Canada
    Posts
    5,217
    change the zorder to 0 of the object, like

    Picture1.ZOrder 0

    will move it to topmost
    Remember, if someone's post was not helpful, you can always rate their post negatively .

  3. #3

    Thread Starter
    Lively Member Smarturtle's Avatar
    Join Date
    Nov 2001
    Location
    INFINITE LOOP
    Posts
    103
    I'm not sure what you mean... i made like a file menu on top of the program... i dont even know how to bring the pic in.. what type of OLE to use.
    •º£ëÖº•

    ____________________________
    If you run alot no matter if you like to or not, it grows on you.... Visual basic has yet to grow on me!

  4. #4
    The picture isn't missing BuggyProgrammer's Avatar
    Join Date
    Oct 2000
    Location
    Vancouver, Canada
    Posts
    5,217
    i dont understand what you mean. post a ascreenshot
    Remember, if someone's post was not helpful, you can always rate their post negatively .

  5. #5

    Thread Starter
    Lively Member Smarturtle's Avatar
    Join Date
    Nov 2001
    Location
    INFINITE LOOP
    Posts
    103
    i dont have anything to post.. lol.

    okay here. I have like 8 images. They are in a folder and i want to use them in my vb project. When someone clicks a menu button i want the image to display on the form that the menu bar is on. Like under the menu bar and centerd. Then when they click another button for another image... another one pops up in that area etc etc

    http://members.cox.net/alexandertheg...screenshot.jpg
    •º£ëÖº•

    ____________________________
    If you run alot no matter if you like to or not, it grows on you.... Visual basic has yet to grow on me!

  6. #6
    Frenzied Member Jim Davis's Avatar
    Join Date
    Mar 2001
    Location
    Mars base one Username: Jim Davis Password: yCrm33
    Posts
    1,284
    place the images inside an imagelist control, then you can create dinamycally some imageboxes, and show the pics from the imagelist inside that/them..

    VB Code:
    1. Private MyPicBox As PictreBox
    2.  
    3. Sub Trick()
    4.  
    5. Set MyPicBox = Form1.Controls.Add("VB.PictureBox","_MyPicBox")
    6.  
    7. 'then you can use this like a design time created picturebox..
    8.  
    9. With MyPicBox
    10.  set .Picture = ...
    11. End With
    12.  
    13. End Sub

    Jim.

  7. #7

    Thread Starter
    Lively Member Smarturtle's Avatar
    Join Date
    Nov 2001
    Location
    INFINITE LOOP
    Posts
    103
    i cant find the image list control... where is it?
    •º£ëÖº•

    ____________________________
    If you run alot no matter if you like to or not, it grows on you.... Visual basic has yet to grow on me!

  8. #8
    PowerPoster Arc's Avatar
    Join Date
    Sep 2000
    Location
    Under my rock
    Posts
    2,336
    I get the feeling you want something simple here.


    Just ad a Picturebox to the middle of your form and in each button write code like this.


    VB Code:
    1. Private Sub Command1_Click()
    2. Dim Pic As New StdPicture
    3. Set Pic = LoadPicture("C:\windows\desktop\First.jpg")
    4. Call Picture1.PaintPicture(Pic, 0, 0, Picture1.Width, Picture1.Height)
    5. Set Pic = Nothing
    6. End Sub
    7.  
    8. Private Sub Command2_Click()
    9. Dim Pic As New StdPicture
    10. Set Pic = LoadPicture("C:\windows\desktop\Second.jpg")
    11. Call Picture1.PaintPicture(Pic, 0, 0, Picture1.Width, Picture1.Height)
    12. Set Pic = Nothing
    13. End Sub

    Where LoadPicture is the path of your picture.
    Last edited by Arc; Jun 5th, 2002 at 12:31 AM.
    -We have enough youth. How about a fountain of "Smart"?
    -If you can read this, thank a teacher....and since it's in English, thank a soldier.


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