Charlie Coleman wrote:

At 11:56 AM 6/22/2006 -0400, MB Software Solutions wrote:

In the thisform.Show method, put the Setfocus command:

For example:

thisform.Show:
this.cboStartingObject.SetFocus


Wouldn't the Form's Activate Event be better? Just curious, I haven't used the Show method so I'm wondering if there is some advantage.


In Kent's example, he keeps the form active and just re-uses it when he needs it. I do that with some screens in Fabmate too--when they're done, I do a .Hide on them, and so when I need them again, I test for the existence and if they exist, I simply skip the NewObject call; then the next command is to Show the form. Here's a snippet from FabMate to demonstrate what I mean:

       IF VARTYPE(this.ofrmMaterial) <> "O" THEN && create form
this.ofrmMaterial = NEWOBJECT("frmMaterial",".\classes\mjbeiw.vcx")
       ELSE && form already exists; just reset values
           this.ofrmMaterial.ResetValues()
       ENDIF && VARTYPE(this.ofrmMaterial) <> "O"
llBatchMode = .t.
       llSaveChanges = .t.
       DO WHILE llBatchMode AND llSaveChanges
           WITH this.ofrmMaterial
               .cMode = "ADD"
               .cSKU = ""

               IF !EMPTY(vItems.cDescription) THEN
                   .cItemDesc = ALLTRIM(vItems.cDescription)
               ENDIF && !EMPTY(vItems.cDescription)
               .txtDescription.SetFocus
               .Show()

               IF .lSaveChanges THEN
this.oBiz.AddMaterial(this.ofrmMaterial.oRecord,liJobID,liItem,liScopeID)
               * else don't bother as user cancelled or data was not valid
               ENDIF && .lSaveChanges
               .ResetValues()
               llBatchMode = .lBatchMode
               llSaveChanges = .lSaveChanges
ENDWITH && this.ofrmMaterial ENDDO && llBatchMode AND llSaveChanges

--
Michael J. Babcock, MCP
MB Software Solutions, LLC
http://mbsoftwaresolutions.com
http://fabmate.com
"Work smarter, not harder, with MBSS custom software solutions!"




_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to