Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Control showing up on wrong page in pageframe
Message
 
 
To
14/11/1999 11:30:09
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00291101
Message ID:
00291116
Views:
18
Keith,

If you are activating another page from the Valid the cbo still has focus which may be what's keeping it visible above the second page. The problem is you can't call the SetFocus method of the Listbox or Page2 from a Valid method, You can call it from LostFocus which just means that you have to artifically force focus out of the cbo.

What you can do, (although in my testing this seems rather disconserting having the page change out from under me just because I selected a value in the cbo) is change your code to something like this:

Make the cbo.Valid:
for i = 1 to 10
   thisform.maList[i] = str( val( this.value ) * 100 + i )
endfor

with this.parent.parent
   .Page2.List1.Requery() && tell lst to update itself
endwith

keyboard "{tab}" && force focus away
Make the cbo.LostFocus:
this.parent.parent.ActivePage = 2
>I built a form in form designer.
>Contains a pageframe. On page 1 I have a combobox with
>a list of vendors. In the valid clause on the cbo I
>populate an array property of a listbox on page2, then use
>...activepage=2. Page2 is displayed, but the cbo from page1
>is also showing!!!
>If I use the pageframe tabs to toggle to page1 and back
>the control goes away. I'm sure the problem is related to
>switching activepage within a control method, but that seems
>a perfectly reasonable thing to do...???..
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Reply
Map
View

Click here to load this message in the networking platform