怎么在vb是实现一个 框架

studyking 2004-08-03 03:56:02
我想怎么样才能实现一个框架,两边可以自由调整大小,象http://community.csdn.net/Expert/Forum.asp 一样,要添加什么控件,顺便问问我怎么样才能将dagagrid中的数据导出到excel 表
...全文
246 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
cqm2099 2004-08-07
  • 打赏
  • 举报
回复
UP
cpio 2004-08-07
  • 打赏
  • 举报
回复
四个控件:
PictureBox:p0 top:0,width:50
PictureBox:p1 top:0
PictureBox:p2 top:0

ImageBox:i1 top:0,width:50

Dim isdraging As Boolean

Private 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 Sub

Private Sub Form_Resize()
change Me.ScaleWidth / 3
End Sub

Private 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 Sub

Private 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 Sub

Private 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
northwolves 2004-08-04
  • 打赏
  • 举报
回复
Private WithEvents cmd1 As CommandButton

Private Sub cmd1_Click()
MsgBox "you click command1 in coolbar1"
End Sub

Private 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


studyking 2004-08-03
  • 打赏
  • 举报
回复
我说的是coolbar 不是 toolbar
bluesky23 2004-08-03
  • 打赏
  • 举报
回复
鼠标右击coolbar,
选择"属性"或者是Properties
会弹出一个对话框,
再选择button页面就可以随意增改按钮了。
studyking 2004-08-03
  • 打赏
  • 举报
回复
顺便问问,coolbar 怎么加 东西,我怎么什么也添加不上
studyking 2004-08-03
  • 打赏
  • 举报
回复
能不能详细点,"应用程序向导" ?怎么弄,
rainstormmaster 2004-08-03
  • 打赏
  • 举报
回复
用应用程序向导 生成一个资源管理器样式的工程,然后,自己看代码

7,765

社区成员

发帖
与我相关
我的任务
社区描述
VB 基础类
社区管理员
  • VB基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧