在Form_Resize中调整,比如以下代码始终使Command1位于窗口的1/4处:
Private Sub Form_Resize()
   Command1.Left=Width/4
End Sub

解决方案 »

  1.   

    你可以在程序启动的时候获取屏幕的分辨率
    照此作出相应的调整.
    试一下下面的代码,可以取得屏幕的分辨率
    可以查阅MSDN来察看更国关于GetDeviceCaps函数的信息Private Declare Function GetDeviceCaps Lib "gdi32" _
       (ByVal hdc As Long, _
        ByVal nIndex As Long) As LongPrivate Const HORZRES As Long = 8
    Private Const VERTRES As Long = 10
    Private Const BITSPIXEL As Long = 12
    Private Const VREFRESH As Long = 116
    Private Sub Command1_Click()   Dim currHRes As Long
       Dim currVRes As Long
       Dim currBPP As Long
       Dim currVFreq As Long
       Dim sBPPtype As String
       Dim sFreqtype As String
       
      'get the system settings
       currHRes = GetDeviceCaps(hdc, HORZRES)
       currVRes = GetDeviceCaps(hdc, VERTRES)
       currBPP = GetDeviceCaps(hdc, BITSPIXEL)
       currVFreq = GetDeviceCaps(hdc, VREFRESH)
       
       
      'pretty up the descriptions a tad
       Select Case currBPP
          Case 4:      sBPPtype = "(16 Color)"
          Case 8:      sBPPtype = "(256 Color)"
          Case 16:     sBPPtype = "(High Color)"
          Case 24, 32: sBPPtype = "(True Color)"
       End Select
       
       Select Case currVFreq
          Case 0, 1:    sFreqtype = "(Hardware default)"
          Case Else:   sFreqtype = "(User-selected)"
       End Select
          
       Label2 = currHRes & " pixels"
       Label3 = currVRes & " pixels"
       Label4 = currBPP & " bits per pixel  " & sBPPtype
       Label5 = currVFreq & " hz  " & sFreqtype
       
    End Sub
      

  2.   

    在form_resize()中调整,怎么调整则要看你自己的要求了,无非就是根据form的size来增减control的sizeto Alpha:
    在这个案例中为什么要那样复杂呢?又不是OpenGL绘图.
      

  3.   

    请用RESIZE控件!
    Resize OCX可以不用编写程序,控制一个Form中Resize时的Controls改变成对应的大小。在国外某VB 3RD的销售榜一直雄居NO.10左右。使用时只要把Resize Control放到Form就可以了。运行是试试改变Form的大小,就....看到啦:)
      

  4.   

    用Screen.width 和 Screen.height可以获得屏幕的大小,然后在Form.resize中调整控件的位置和大小,比如让一个窗口启动是在屏幕中央
    form.move (screen.width - form.width) \ 2, (screen.height - form.height)\2
      

  5.   

    resize 控件为什么要钱?有没有不要钱的?Thanks
      

  6.   

    resize控件我已经download的,不过是demo,每次关闭程序都会弹出一个对话框说什么“Demo Version”,这样太差了,哪里可以找到这个控件的crack?
      

  7.   

    resize控件我已经download的,不过是demo,每次关闭程序都会弹出一个对话框说什么“Demo Version”,这样太差了,哪里可以找到这个控件的crack?