我抄来的代码是
Me.Move Screen.Width * 0.75, Screen.Height * 0.75, _
           Screen.Width \ 4, Screen.Height \ 4但是窗体出现时却不是我设置的窗体的原始大小,请问要怎么设置才可以变成我设置的原始尺寸出现在右下角。
 还有如果不麻烦的话,请问 这段代码的解释是怎么样的 我把它改成
Me.Move Screen.Width * 0.375, Screen.Height * 0.375, _
           Screen.Width \ 8, Screen.Height \ 8
结果错得离谱。
请有空的老师指点下 谢谢

解决方案 »

  1.   

    代码好象不完整,我补充下
    Private Declare Function SetWindowPos Lib "user32" (ByVal hWnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As LongMe.Move Screen.Width * 0.75, Screen.Height * 0.75, _
               Screen.Width \ 4, Screen.Height \ 4 
    SetWindowPos Me.hWnd, HWND_TOPMOST, Me.Left \ Screen.TwipsPerPixelX, Me.Top \ Screen.TwipsPerPixelY, Me.Width, Me.Height, 1
       X1 = 0
       Y1 = Me.Width \ Screen.TwipsPerPixelX
       
       X2 = Me.Width \ Screen.TwipsPerPixelX
       Y2 = Me.Height \ Screen.TwipsPerPixelY - 1
      

  2.   

    简单点的:
    Me.Move Screen.Width - Me.Width, Screen.Height - Me.Height
    用API就这样:
    SetWindowPos Me.hWnd, -1, (Screen.Width - Me.Width) / Screen.TwipsPerPixelX, (Screen.Height - Me.Height) / Screen.TwipsPerPixelY, Me.Width / Screen.TwipsPerPixelX, Me.Height / Screen.TwipsPerPixelY, 1
      

  3.   

    Me.Move Screen.Width - Me.Width, Screen.Height - Me.Height, Me.Width, Me.Height