WD6X: DlgFocus Statement Does Not Change the Focus in MacWord

Last reviewed: February 3, 1998
Article ID: Q126024
The information in this article applies to:
  • Microsoft Word for the Macintosh, version 6.0, 6.0.1

SUMMARY

The Microsoft WordBasic DlgFocus statement is used within a dialog function to set the focus on the dialog box control. However, the DlgFocus statement does not change the focus in a Word 6.0 for the Macintosh dialog box.

MORE INFORMATION

Microsoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific needs. If you have limited programming experience, you may want to contact the Microsoft fee-based consulting line at (800) 936-5200. For more information about the support options available from Microsoft, please see the following page on the World Wide Web:

   http://www.microsoft.com/supportnet/refguide/ 

When a dialog box control has the focus, it is active and responds to keyboard input. For example, if a text box has the focus, any text you type appears in that text box. Buttons with focus appear to have a darker ring around them. The DlgFocus statement does not return a WordBasic error when used in a Macintosh Word macro, but the focus is not set to the control.

In the following sample macro, the DlgFocus statement in Case 1 of the dialog function has no effect. If this macro is run in Word 6.x for Windows, the focus is correctly set to the "MyControl1" control.

   Sub Main
      Begin Dialog UserDialog 320, 144, "Microsoft Word", .MyDlgFunction
         OKButton 10, 6, 88, 21
         CancelButton 10, 30, 88, 21
         PushButton 57, 101, 88, 21, "Mybutton", .MyControl1
      End Dialog
      Dim dlg As UserDialog
      x = Dialog(dlg)
   End Sub

   Function MyDlgFunction(identifier$, action, suppvalue)
      Select Case action
         Case 1
            DlgFocus "MyControl1"
         Case Else
      End Select
   End Function

REFERENCES

"Microsoft Word Developer's Kit," version 6.0, Chapter 5, "Working with Custom Dialog Boxes"


Additional query words: dynamic
Keywords : kbmacroexample macword word6 kbcode kbmacro kbprg
Version : MACINTOSH:6.0,6.0.1,6.0.1a
Platform : MACINTOSH
Issue type : kbinfo


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: February 3, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.