如果屏幕分辨率大小是1024*768则让窗体最大化反之不做处理大家给点代码吧,我找了好久都找不到

解决方案 »

  1.   

        IF Screen.TwipsPerPixelX=15 AND Screen.TwipsPerPixelY=15 Then
      

  2.   

     IF Screen.Width\Screen.TwipsPerPixelX =1024 AND Screen.Height\   Screen.TwipsPerPixelY   =768 Then也可
      

  3.   


    GetSystemMetrics(SM_CXSCREEN)
    GetSystemMetrics(SM_CYSCREEN)
    VB自带的有时候返回的值会有错误,之前写改键器的时候遇到过
      

  4.   

    可以使用下面的代码取得后进行判断,代码来自http://bingning.net/free/source/system/displaysize.htmlDim h, w As Integer
     '显示器的显示范围高度
     h = System.Windows.Forms.Screen.GetWorkingArea(Me).Height
     '显示器的显示范围宽度
     w = System.Windows.Forms.Screen.GetWorkingArea(Me).Width
      

  5.   

    If Screen.Width\Screen.TwipsPerPixelX =1024 AND Screen.Height\  Screen.TwipsPerPixelY  =768 ThenEnd If
      

  6.   

    Const   SWP_NOMOVE   As   Long   =   &H2   
      Const   SWP_NOSIZE   As   Long   =   &H1   
      Const   FLAG   =   SWP_NOMOVE   Or   SWP_NOSIZE   
      Const   HWND_TOPMOST   =   -1   
      Const   HWND_NOTOPMOST   =   -2   
      Const   HWND_TOP   =   0   
      Const   HWND_BOTTOM   =   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   Long   
        
        Private   Sub   Form_Load()   
        Me.Move   0,   0,   Screen.Width,   Screen.Height   
        Call   SetWindowPos(Me.hwnd,   HWND_TOPMOST,   0,   0,   0,   0,   FLAG)   
        End   Sub怎么改成,让窗体大小1024*768分辨率下的最大化
    如果是别的分辨率,就不执行最大化?大家教下我
      

  7.   

    Private Declare Function GetSystemMetrics Lib "user32" (ByVal nIndex As Long) As Long
    Private Const SM_CXSCREEN = 0
    Private Const SM_CYSCREEN = 1if GetSystemMetrics(SM_CXSCREEN)=1024 and GetSystemMetrics(SM_CYSCREEN)=768 then
    全屏
      

  8.   

    If Screen.Width\Screen.TwipsPerPixelX =1024 AND Screen.Height\  Screen.TwipsPerPixelY  =768 Then  ....