How to reposition a form in Access through code?

你。 提交于 2019-12-11 11:46:46

问题


I want to move a form to the screen's left side in Access 2007 in the onOpen event. I've not found how to do it using form properties, because top and left properties seems to be read only through code during runtime.

Do I need call API methods to move a form in Access to another position on screen? Is there a quick way to do it?


回答1:


Look at Access' Help topic for the Move method.

This sample is code behind a command button which will re-position the current form. If you supply the Width and Height arguments, you can also use Move to resize the form.

Private Sub cmdMoveForm_Click()
    'Me.Move Left:=0, Top:=0, Width:=400, Height:=300 '
    Me.Move Left:=2970, Top:=1860
End Sub

Note the numbers are in twips: 1440 twips per inch; or 567 twips per centimeter.



来源:https://stackoverflow.com/questions/6572807/how-to-reposition-a-form-in-access-through-code

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!