Forum Discussion

vthomeschoolmom's avatar
vthomeschoolmom
Super Contributor
15 years ago

form height

I am trying to change the size of a form so that the entire grid is visible when I take a screen shot. I do not want to drag with coordinates. I see a height property in the Display Object Properties tool. I see in the help file that this is a read / write property to get or set the height. Perfect! But when I use it, I get an error



An exception occurred in the "d_0013_Step1" unit at line 41:

Microsoft VBScript runtime error

Wrong number of arguments or invalid property assignment: 'Sys.Process(...).VBObject(...).Height'



On



Sys.Process("MyApp").VBObject("frmCust").Height = 700



I can read the height just fine.



Details

VB6 application

Test Complete 7.



Please help.

4 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor
    Just checking: Is it possible that when you call that Height property that the form in question is not found yet in the object hierarchy? I'd do a quick "if WaitVBObject.exists call before you try and set the height, just in case.
  • I did a



    set frmCust= Sys.Process("MyApp").WaitVBObject("frmCust", 3000)



    right before. It is successfully being found.



    Thanks for the try!

  • Hello Lane,





    The Height property is read-write for TestComplete's user forms components and read-only for other windows. To change the size of a form, you can use the Position method. For example:



    Sub Test

      Set frmCust = Sys.Process("MyApp").VBObject("frmCust")

      Call frmCust.Position(frmCust.Left, frmCust.Top, frmCust.Width, 700) 

    End Sub