¥¥¥¥ datagrid如何获得第i行j列的内容

dofty 2003-08-21 10:44:49
还有,datagrid如何设定初始各个列的大小?能不能可视化操作?


...全文
44 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
lzj34 2003-08-21
  • 打赏
  • 举报
回复
DataGrid1.Columns(0).Width = 200
DataGrid1.Columns(1).Width = 500

lzj34 2003-08-21
  • 打赏
  • 举报
回复
Private Sub datagrid_Click()


On Error GoTo errors
Dim pathstr As String
DoEvents
If mintcount <> Adodc1.Recordset.AbsolutePosition Then textmask.Visible = False
pathstr = Form1.Adodc1.Recordset.Fields("path")
'此处获得所要数据
If pathstr = "" Then GoTo errors
If LCase(Right(RTrim(pathstr), 4)) = ".txt" Then
gstrpath = App.Path & "\text\" & pathstr
Else
gstrpath = App.Path & "\text\" & pathstr & ".txt"
End If
If Dir(gstrpath) = "" Then MsgBox "此部分内容联接错误,请确认文件名(" & pathstr & ".txt)正确!", vbCritical: GoTo errors
Form2.Show
Timer2.Enabled = False
'Unload Me
errors:
textmask.Visible = False
Exit Sub
End Sub
lihonggen0 2003-08-21
  • 打赏
  • 举报
回复
DataGrid1.Row = 2
a = DataGrid1.Columns(1).Text
qingming81 2003-08-21
  • 打赏
  • 举报
回复
dim i as long
dim j as long

for i = 1 to 10
For j = 0 To datagrid1.columns.count-1
MsgBox DataGrid1.Columns.Item(j)
Next j
next i
hzybc 2003-08-21
  • 打赏
  • 举报
回复
DataGrid1.Row = i-1
DataGrid1.Col = j-1
text1.text=DataGrid1.Text

列的大小是不是指列的宽度的大小?
是的话就用
DataGrid1.Columns(0).Width = 200
DataGrid1.Columns(1).Width = 500
馮強 2003-08-21
  • 打赏
  • 举报
回复
DataGrid1.row = i - 1
DataGrid1.col = j - 1

msgbox '你选定的内容:' & DataGrid1.Text
atlasGS 2003-08-21
  • 打赏
  • 举报
回复
DataGrid1.Row = 1
DataGrid1.Col = 1
text1.text=DataGrid1.Text
atlasGS 2003-08-21
  • 打赏
  • 举报
回复
DataGrid1.Row = 1
DataGrid1.Col = 1
DataGrid1.Text = "1111"
xingnup 2003-08-21
  • 打赏
  • 举报
回复
改变列宽的可视化操作,在DataGrid控件按右键选择编辑便可.

1,216

社区成员

发帖
与我相关
我的任务
社区描述
VB 数据库(包含打印,安装,报表)
社区管理员
  • 数据库(包含打印,安装,报表)社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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