BUG: Form Move Event Can Generate Error Message

Last reviewed: February 10, 1998
Article ID: Q180767
The information in this article applies to:
  • Windows CE Toolkit for Visual Basic 5.0, version 1.0

SYMPTOMS

When the Move method of a form or control is used without all of the parameters, one of the following error messages is generated:

    An error was encountered while running this program.

    -or-

    Wrong number of arguments or invalid property assignment.

RESOLUTION

The workaround is to use all of the parameters of the Move method.

STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this bug and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Create a new Windows CE project in Visual Basic 5.0. Form1 is created by default.

  2. Add the following code to the Form1 code module:

          Private Sub Form_Load()
    
             On Error Resume Next
             Form1.Width = 200 * Screen.TwipsPerPixelX
             Form1.Height = 100 * Screen.TwipsPerPixelY
             'Center Form on screen
             Form1.Move (Screen.Width - Form1.Width) \ 2, _
                (Screen.Height - Form1.Height) \ 2
             'Display error information
             If Err.Number <> 0 Then
                MsgBox "Error: " & Err.Number & " - " & _
                   Err.Description, vbInformation, "Error Message"
             End If
          End Sub
    
    

  3. Press the F5 key to run the project. A message box appears with the message "Error 450: Wrong number of arguments or invalid property assignment."

    NOTE: By trapping the error message, a more descriptive message can be displayed. Otherwise, the message "An error was encountered while running this program" appears.

(c) Microsoft Corporation 1998, All Rights Reserved. Contributions by Mike Dixon, Microsoft Corporation
Keywords          : vb5all vbce
Version           : WINDOWS:1.0
Platform          : WINDOWS
Issue type        : kbbug
Solution Type     : kbnofix


================================================================================


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 10, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.