MSHFLEXGRID控件网格怎么随着内容长短变化而变化?

hn123 2004-08-04 09:29:26
RT
...全文
160 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
hfy2003 2004-09-03
  • 打赏
  • 举报
回复
mark
hn123 2004-08-04
  • 打赏
  • 举报
回复
没有别的办法了吗?
daisy8675 2004-08-04
  • 打赏
  • 举报
回复
不行,如果太长你换行显示,要么你用trimer不断去检测变化情况,但是方法不好ei
efengxu 2004-08-04
  • 打赏
  • 举报
回复
关注中:)
华芸智森 2004-08-04
  • 打赏
  • 举报
回复

Dim M_Col As Long

Private Sub Form_Load()
Text1.Visible = False
End Sub

Private Sub MSHFlexGrid1_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
With MSHFlexGrid1
M_Col = .MouseCol
Text1.Visible = False
Text1.Move .Left + .CellLeft, .Top + .CellTop, .CellWidth, .CellHeight
Text1.Text = .Text
Text1.Visible = True
Text1.SetFocus
End With
End Sub

Private Sub Text1_Change()
Dim OleWidth As Long
Dim NewWidth As Long

With MSHFlexGrid1
.Text = Text1.Text
OleWidth = Text1.Width
NewWidth = TextWidth(Text1.Text)
If NewWidth > OleWidth Then
.ColWidth(M_Col) = NewWidth
Text1.Width = NewWidth
End If
End With
End Sub

1,451

社区成员

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

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