编译错误:子程序或函数未定义

chenhuayao 2006-04-08 09:15:22
Private Sub txtItem_GotFocus(Index As Integer)

txtItem(Index).SelStart = 0  'texItem ...... ?????怎么回事???
txtItem(Index).SelLength = Len(txtItem(Index))
End Sub
...全文
444 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
浪子家园 2006-09-09
  • 打赏
  • 举报
回复
不要用关键字作控件名或变量或数组名称
applekiller 2006-04-14
  • 打赏
  • 举报
回复
做个函数
private sub AutoSelecteText(ctr as control)
if typeof ctr is textbox then
ctr.selstart=0
ctr.sellength=len(ctr.text)
endif
end sub

调用:
Private Sub txtItem_GotFocus(Index As Integer)
AutoSelecteText txtItem(index)
End Sub

of123 2006-04-14
  • 打赏
  • 举报
回复
是否有“笔误”,是否有中文空格?

可以将语句重新写一遍试试。
chenhuayao 2006-04-14
  • 打赏
  • 举报
回复
是啊
faysky2 2006-04-08
  • 打赏
  • 举报
回复
看看你的控件的名称是不是 txtItem
faysky2 2006-04-08
  • 打赏
  • 举报
回复
你的txtItem控件如果不是控件,不能那样写

1,066

社区成员

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

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