Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Ken Murphy
  Where is Ken Murphy?
 Springhill
 Canada
 Ken Murphy
 To: Khurram Tahir
  Where is Khurram Tahir?
 Karachi
 Pakistan
 Khurram Tahir
 Tags
Subject: RE: Check control not hide on setting
Thread ID: 143400 Message ID: 143522 # Views: 1 # Ratings: 0
Version: Visual FoxPro 9 Category: Projects and Design
Date: Wednesday, August 29, 2007 2:31:15 PM         
   


> >
> > Khurram,
> >
> > I am unsure of what it is that you wish to have happen. Can you explain what your deisred results are and how your code does not produce those desired results.
> >
> > It sounds as if you want to make a checkbox visible or not visible in the interactive change event. Is the checkbox located in a column? Is it located outside of the grid? You use This.Value in your IF statement, but what is the controlsource behind that "This"?
> >
> > Ken
> > You shall know the truth - and the truth shall set you free. (John 8:33)
>
> This check control is on form not a column
>
> All above code is in the interactinve change event of check
>
> Purpose:
>
> IF check value is 1 it set the combo box listindex to 0 and after that it will also change the value of check to 0 and visible to .f. so when user again select any value from combo whose rowsource is a field of a table it again put the check to visible .T. for user

Khurram,

Take a look at your code here:
IF THIS.Value = 1 && SELECTED
   THISFORM.CmbAccna.ListIndex = 0
   STORE 0 TO THIS.Value 
ENDIF 

IF THIS.Value = 0 
   STORE .F. TO THIS.Visible 
   THIS.Refresh()
   THISFORM.Refresh() 
ENDIF   

** your code is equivalent to:
IF THIS.Value = 1 && SELECTED
   THISFORM.CmbAccna.ListIndex = 0
   STORE 0 TO THIS.Value 
ENDIF 

STORE .F. TO THIS.Visible 
THIS.Refresh()
THISFORM.Refresh() 

Because you set This.Value to 0 in the first IF construct, by the time that you reach the second IF construct, This.Value will ALWAYS be zero.

I am still not really sure what you are looking for, but I think you may want this:
IF THIS.Value = 1 && SELECTED
   THISFORM.CmbAccna.ListIndex = 0
   STORE 0 TO THIS.Value 
ELSE
   STORE .F. TO THIS.Visible 
   THIS.Refresh()
   THISFORM.Refresh() 
ENDIF   



Ken
You shall know the truth - and the truth shall set you free. (John 8:33)

ENTIRE THREAD

Check control not hide on setting Posted by Khurram Tahir @ 8/28/2007 3:47:17 PM
RE: Check control not hide on setting Posted by Ken Murphy @ 8/28/2007 4:08:14 PM
RE: Check control not hide on setting Posted by Khurram Tahir @ 8/29/2007 7:41:29 AM
RE: Check control not hide on setting Posted by Ken Murphy @ 8/29/2007 2:31:15 PM
RE: Check control not hide on setting Posted by Cetin Basoz @ 8/28/2007 11:44:23 PM