Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pages and Listboxes

Status
Not open for further replies.

chpicker

Programmer
Apr 10, 2001
1,316
I have a pageframe with 3 pages, each of which has a Listbox. The first time each page comes up, everything works fine. However, for pages 2 and 3, the second and each subsequent time that page is activated, the list box doesn't repaint itself, giving you a box which contains whatever was on the page you just left. You can still access it, and the listbox's items will redraw themselves as you move the cursor...but to get the listbox to repaint itself I have to minimize and restore the app.

I have tried putting Refresh commands into the page.activate methods (both thisform.refresh and this.list1.refresh), I've tried putting "this.refresh" into the GotFocus event of the listbox itself...same results. This is very annoying, frustrating, and unprofessional looking to my boss, and I'm completely stumped as to WHY it's doing this. Any suggestions?
 
Update to the problem: it only happens when the keyboard shortcuts are used, whether it be the ALT+letter to activate the page or the ALT+letter to click a command button that changes pages. If you click with the mouse, everything works perfectly.

*pulls his hair out*
 
So does the code in the shortcuts just point to the appropriate click or other mouse event or not? It they have their own code, they might not be properly pointed to what you think they're pointed to. You might try throwing in a few asserts to see what's got the focus when, etc.

Dave Dardinger
 
No, the shortcuts don't have code...I'm referring to the underlined letter in the caption using the &quot;\<&quot; symbol.
 
Try putting the following code in the activate event of each page in your pageframe:

local llocked
llocked = thisform.lockscreen
thisform.lockscreen = .t.
this.refresh
thisform.lockscreen = llocked

The problem is that pages do not always get refreshed when brought to the surface.

The extra lockscreen code improves performance somewhat and avoids the rippling refresh effect if you have a lot of objects on the page.

 
I'll give it a try, although I already have &quot;thisform.refresh&quot; in the activate code of each page. I will try it with the lockscreens.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top