怎样将MSFlexGrid与TextBox绑定????? 向各位大虾请教一个问题我想实现当鼠标选中MSFlexGrid控件中一行记录时,TextBox也能随之改变!! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 private sub msflexgrid_click()text1.text=msflexgrid.textend sub 是一行记录,有多个字段,分别绑定到不同textbox上 刚好这个合适: http://www.hosp.ncku.edu.tw/~cww/html/q00184.html 如果你安裝了MSDN,那裏有你想要的代碼。 你的命运真好,我们刚做完这个,别忘了给分阿代码给你贴出来了 Dim intNoteLeft As Integer Dim intNoteWidth As Integer Dim intNoteTop As Integer Dim intNoteHeight As Integer Dim strSelectKey As String intNoteLeft = m_lsvSelect.CellLeft + m_lsvSelect.Left intNoteWidth = m_lsvSelect.CellWidth intNoteTop = m_lsvSelect.CellTop + m_lsvSelect.Top intNoteHeight = m_lsvSelect.CellHeight strSelectKey = m_lsvSelect.TextMatrix(m_lsvSelect.Row, 3) If m_lsvSelect.Col = 0 Then m_txtName.Move intNoteLeft, intNoteTop, intNoteWidth, intNoteHeight m_txtName.Text = m_lsvSelect.Text m_txtName.SelLength = Len(m_txtName.Text) m_thisName = m_txtName.Text m_txtName.Visible = True m_txtName.SetFocus ElseIf m_lsvSelect.Col = 1 Then m_txtA1.Move intNoteLeft, intNoteTop, intNoteWidth, intNoteHeight m_txtA1.Text = m_lsvSelect.Text m_txtA1.SelLength = Len(m_txtA1.Text) m_thisA1 = m_txtA1.Text m_txtA1.Visible = True m_txtA1.SetFocus ElseIf m_lsvSelect.Col = 2 Then m_txtA0.Move intNoteLeft, intNoteTop, intNoteWidth, intNoteHeight m_txtA0.Text = m_lsvSelect.Text m_txtA0.SelLength = Len(m_txtA0.Text) m_thisA0 = m_txtA0.Text m_txtA0.Visible = True m_txtA0.SetFocus End If TxtInput.Top = FGrid.CellTop + 240 TxtInput.Left = FGrid.CellLeft + 120 TxtInput.Height = FGrid.CellHeight TxtInput.Width = FGrid.CellWidth TxtInput.Text = FGrid.Text TxtInput.Visible = True TxtInput.SetFocus vb读取注册表后怎么进行字符串比较? 关于对象的定义问题 换工作了,散分 简单的问题 100分求两函数! 关于msgbox的使用 VB如下方案,我该选用哪个控件来显示数据库表信息?这个题目有点难,详情请点击链接。 怎么根据用户的查询条件改access中的表? 如何设计报表 谁有VB 用的 SP5 ,SP6? 脚本语言~~~~求救~~急 关于用winsock进行数据发送的问题,请大家帮帮忙
text1.text=msflexgrid.text
end sub
代码给你贴出来了
Dim intNoteLeft As Integer
Dim intNoteWidth As Integer
Dim intNoteTop As Integer
Dim intNoteHeight As Integer
Dim strSelectKey As String
intNoteLeft = m_lsvSelect.CellLeft + m_lsvSelect.Left
intNoteWidth = m_lsvSelect.CellWidth
intNoteTop = m_lsvSelect.CellTop + m_lsvSelect.Top
intNoteHeight = m_lsvSelect.CellHeight
strSelectKey = m_lsvSelect.TextMatrix(m_lsvSelect.Row, 3)
If m_lsvSelect.Col = 0 Then
m_txtName.Move intNoteLeft, intNoteTop, intNoteWidth, intNoteHeight
m_txtName.Text = m_lsvSelect.Text
m_txtName.SelLength = Len(m_txtName.Text)
m_thisName = m_txtName.Text
m_txtName.Visible = True
m_txtName.SetFocus
ElseIf m_lsvSelect.Col = 1 Then
m_txtA1.Move intNoteLeft, intNoteTop, intNoteWidth, intNoteHeight
m_txtA1.Text = m_lsvSelect.Text
m_txtA1.SelLength = Len(m_txtA1.Text)
m_thisA1 = m_txtA1.Text
m_txtA1.Visible = True
m_txtA1.SetFocus
ElseIf m_lsvSelect.Col = 2 Then
m_txtA0.Move intNoteLeft, intNoteTop, intNoteWidth, intNoteHeight
m_txtA0.Text = m_lsvSelect.Text
m_txtA0.SelLength = Len(m_txtA0.Text)
m_thisA0 = m_txtA0.Text
m_txtA0.Visible = True
m_txtA0.SetFocus End If
TxtInput.Left = FGrid.CellLeft + 120
TxtInput.Height = FGrid.CellHeight
TxtInput.Width = FGrid.CellWidth
TxtInput.Text = FGrid.Text
TxtInput.Visible = True
TxtInput.SetFocus