请问各位,怎样编一个程序的界面既能在1024*768上看得全部又能在800*600上运行看得全部呢?
我原先编在17寸1024*768编一个程序,在800*600的15寸的显示器上运行发现显示那些窗体好大且和原先设计的位置偏移了,大家有什么简单解决方法,推荐一下。

解决方案 »

  1.   

    试试看这样行不行
    Private Sub Form_Resize()
        Me.Width = Screen.Width
        Me.Height = Screen.Height
    End Sub
      

  2.   

    800*600:
    screen.Width /15=800,screen.Height/15=600
    1024*768:
    screen.Width /15=1024,screen.Height/15=768
    先在800*600模式下设计调整窗体,记下各个空间的left,top,width,height
    然后在1024*768(默认)调整窗体部件大小和位置。代码判断:
    if  screen.Width /15=800 then 
    '800*600的控件位置属性值(包括form)
    end if
    1024*768的不改变控件位置属性
      

  3.   

    '在800*600下设计,再加上如下代码!已测试通过,通用的!
    Private Sub Form_Load()
     Dim x As Control
    If Screen.Width / 15 = 1024 Then
        For Each x In Form1.Controls
        x.Left = x.Left * 1.28
        x.Font.Size = x.Font.Size * 1.28
        x.Top = x.Top * 1.28
        x.Width = x.Width * 1.28
        x.Height = x.Height * 1.28
        Next
    End IfEnd Sub
      

  4.   

    找個Resize控件, 能自動根據窗體大小來調整各個控件大小, 這樣就不會存在比例不協調的問題
      

  5.   

    '在800*600下设计,再加上如下代码!已测试通过,通用的!
    窗体未必是form1,所以再改一下
    Private Sub Form_Load()
     Dim x As Control
    If Screen.Width / 15 = 1024 Then
        For Each x In Me.Controls
        x.Left = x.Left * 1.28
        x.Font.Size = x.Font.Size * 1.28
        x.Top = x.Top * 1.28
        x.Width = x.Width * 1.28
        x.Height = x.Height * 1.28
        Next
    End IfEnd Sub
      

  6.   

    在800*600下编写,加上Resize控件
      

  7.   

    设计时Me.WindowState = 2,最大化
    也可以加到Sub Form_Load()中:'Private Sub Form_Load()
     Dim x As Control
    Me.WindowState = 2
    If Screen.Width / 15 = 1024 Then
        For Each x In Me.Controls
        x.Left = x.Left * 1.28
        x.Font.Size = x.Font.Size * 1.28
        x.Top = x.Top * 1.28
        x.Width = x.Width * 1.28
        x.Height = x.Height * 1.28
        Next
    End IfEnd Sub
      

  8.   

    Mark一下,个人觉得jxgzay(jxgzay) ( )的方法不错,可以一试,修改一下就可以用在任何尺寸的分辨率下面了。