在窗体中有一Toolbar,一个Statusbar,一个图片框,还有菜单,代码怎么写使图片框充满剩下的窗体空间

解决方案 »

  1.   

    在Form_load和Form_Resize事件中都写下如下语句便可
       Picture1.Top = Toolbar1.Height
        Picture1.Left = 0
        Picture1.Width = Me.ScaleWidth
        Picture1.Height = Me.ScaleHeight - Toolbar1.Height - StatusBar1.Height
      

  2.   

    Picture1.Move 0, Me.Top - Toolbar1.Height, Me.Width, Me.Height - Toolbar1.Height - StatusBar1.Height
      

  3.   

    Private Sub Form_Resize()
        Picture1.Top = Toolbar1.Top + Toolbar1.Height
        Picture1.Left = 0
        Picture1.Width = Me.Width
        Picture1.Height = Me.ScaleHeight - StatusBar1.Height - Toolbar1.Height
        Picture1.BackColor = vbRed
    End Sub