Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Dale Dedoroy
  Where is Dale Dedoroy?
 Bacolod City, Negros Occidental
 Dale Dedoroy
 To: ernesto paez
  Where is ernesto paez?
 Florida - United States
 ernesto paez
Subject: RE: what to do to change or replace in a form a picture according to the action took
Thread ID: 414 Message ID: 416 # Views: 2 # Ratings: 0
Version: Unknown Category: General VFP Topics
Date: Monday, May 28, 2001 10:34:16 PM         

> Hi
> i have a little password form that include a label, a textbox, a picture wich is a happy face and an OK button BEFORE the user enter a password the picture shows the happy face, what i want to do is if a user enter a wrong password i want the happy face to change to sad face.
> how can i do this ?
> what code do i need and where this code should go ?
> note: i guess that should be in the ok click event
> thank you for your help

You're right. The code CAN be included in the OK button click event but there are many ways actually, like the Valid event of the text box where the user types his/her password.

To change the picture, do something like this in the click even of your OK button:

Local llPasswordOK,lcSadFace
** evaluation of password here
** if password not registered or not valid
llPasswordOK = .F.
If Not llPasswordOK
lcSadFace = 'C:\MyImages\SadFace.Bmp' &&you may change this accordingly
ThisForm.Image1.Picture = lcSadFace
MessageBox('Sorry, your password is invalid. Try again.',16,[PASSWORD DOESN'T MATCH!]')