Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Control source isn't updated
Message
 
 
À
08/09/2000 12:01:59
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00414182
Message ID:
00414523
Vues:
27
Hi Francisco,

Yes this was a real pain in the rump back in VFP 5.0 and it was hard to reproduce if you didnt know exactly what to do.

The behavior occurs when you are on a control and you click on a part of the page object that is not covered by a control. When you do this, the control appears to have updated its controlsource but if you click back on the control, you will notice that the value reverts back. It is the equivalent effect of clicking on a toolbar - the lose focus doesnt fire and the controlsource does not get updated.

The problem occurs whether the control is on a page frame or not.

The simple answer is that your pages need underwear < g >. If you put a barrier between the page and the mouse, clicking on the barrier causes the control to lose focus properly and update the controlsource.

The quick solution is to add a line object to the page of the pageframe, stretch the line to the dimension of the page. You could put the following into the init of the pageframe:
WITH this.page1

  *-- Add a line object to the page
  .AddObject("oUnderwear","line")

  WITH .oUnderwear
       *-- place it at 0,0 and stretch it to fit the page
       .Top  = 0
       .Left = 0 
       .Width  = this.PageWidth
       .Height = this.PageHeight
       
       *-- Make it visible so that it can receive focus
       .Visible=.t.
       
       *-- Set the borderstyle to transparent
       .BorderStyle = 0

       *-- Send it to the bottom of the zorder
       .Zorder(1)
  ENDWITH
ENDWITH
I have uploaded a file called pgfbug.zip in the Visual Foxpro in General section of the files area of the UT. It demonstrates the problem and shows a solution. Also included is a pageframe class (in barrier.zip) that automatically adds the lines to the pages of pageframes and even checks in the refresh to make sure that all pages have a barrier, and if any dont (because of dynamic adding of pages for instance) it adds them to the page.

Hope this helps,

Rick

>I have a textbox in a page of a pageframe with the controlsource property pointing to a field in a table.
>
>I key in a value in the textbox and then click somewhere in the page (not in another control but in a free space of the page)
>
>The textbox lost the focus but the controlsource wasn't updated.
>
>This behaviour doesn't happen in VFP6. It only happens in VFP5.
>
>Anyone know a workaround ?
Rick Hodder
MCP Visual Foxpro
C#, VB.NET Developer
Independent Consultant
www.RickHodder.com
MyBlog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform