Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Beginning VB 6
|
Beginning VB 6 For coders who are new to Visual Basic, working in VB version 6 (not .NET).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 11th, 2006, 02:33 AM
Registered User
 
Join Date: Mar 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to replace a picture with another when clicked

Code:
Under the Picture_Click event, how would you change the picture from one to another?  

I already tried 

     picNorm(Index).picture = picSel.picture

but VB returns with a Compile Error: Method or data member not found.
(The red text is what is highlighted in my code)

Just post if you need any more info.
 
Old March 11th, 2006, 06:27 AM
Authorized User
 
Join Date: Mar 2006
Posts: 80
Thanks: 0
Thanked 0 Times in 0 Posts
Default

One way:

On Form create new picturebox, and on Picture_Click event type

Private Sub PictureNorm_Click
  PictureNorm.Picture = PictureSel.Picture
End Sub

Other way:

Private Sub PictureNorm_Click
  PictureNorm.Picture = LoadPicture(path & pictureName)
End Sub


 
Old March 11th, 2006, 04:08 PM
Registered User
 
Join Date: Mar 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks, apparently VB doesn't like
   picX.Picture = picY.Picture
but lets me do
   picX = picY






Similar Threads
Thread Thread Starter Forum Replies Last Post
which row is clicked in gridwiew vipsis ASP.NET 2.0 Basics 1 March 13th, 2007 07:22 AM
close the frame this is in when clicked crmpicco HTML Code Clinic 2 August 31st, 2005 08:23 AM
How to tell which button clicked emily PHP How-To 2 November 30th, 2004 01:35 PM
OLE picture - accessing the picture property bdcrisp Excel VBA 0 December 7th, 2003 09:35 PM
Full-sized window once clicked on picture Burton HTML Code Clinic 4 August 15th, 2003 09:08 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.