我想怎么样才能实现一个框架,两边可以自由调整大小,象http://community.csdn.net/Expert/Forum.asp 一样,要添加什么控件,顺便问问我怎么样才能将dagagrid中的数据导出到excel 表

解决方案 »

  1.   

    顺便问问,coolbar 怎么加 东西,我怎么什么也添加不上
      

  2.   

    鼠标右击coolbar,
    选择"属性"或者是Properties
    会弹出一个对话框,
    再选择button页面就可以随意增改按钮了。
      

  3.   

    我说的是coolbar 不是 toolbar
      

  4.   

    Private WithEvents cmd1 As CommandButtonPrivate Sub cmd1_Click()
    MsgBox "you click command1 in coolbar1"
    End SubPrivate Sub Form_Load()
    Set cmd1 = Me.Controls.Add("vb.commandbutton", "cmd1", CoolBar1)
    cmd1.Visible = True
    cmd1.Caption = "commandbutton in toolbar"
    cmd1.Move 0, 0, CoolBar1.Bands(1).Width / 2, CoolBar1.Height / 2
    End Sub
      

  5.   

    四个控件:
    PictureBox:p0 top:0,width:50
    PictureBox:p1 top:0
    PictureBox:p2  top:0ImageBox:i1 top:0,width:50Dim isdraging As BooleanPrivate Sub Form_Load()
    change Me.ScaleWidth / 3
    End Sub
    Private Sub change(X As Integer)
    If X < 1000 Then X = 1000
    If X > Me.ScaleWidth - 1000 Then X = Me.ScaleWidth - 1000
    p0.Height = Me.ScaleHeight
    p1.Height = Me.ScaleHeight
    p2.Height = Me.ScaleHeight
    i1.Height = Me.ScaleHeight
    p0.Left = X
    p1.Width = X
    i1.Left = X
    p2.Left = X + 50
    p2.Width = Me.ScaleWidth - X - 50
    End SubPrivate Sub Form_Resize()
    change Me.ScaleWidth / 3
    End SubPrivate Sub i1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
        isdraging = True
        p0.Left = i1.Left
        p0.Visible = True
    End SubPrivate Sub i1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
        If isdraging Then
            change X + i1.Left
        End If
    End SubPrivate Sub i1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If isdraging Then
        isdraging = False
        p0.Visible = False
    End If
    End Sub