privante sub cmdGet(strText as string)
select case trim(strText)
case "text1"
textme.text=text1.text
case "text2"
textme.text=text2.text
case "txtother"
textme.text=txtother.text
case "txtage"
textme.text=txtage.text
…………
end select
end sub
这段程序谁看了都要烦死了,有没有更好的办法
注:strText是字符串型,不可以改成对象型。
select case trim(strText)
case "text1"
textme.text=text1.text
case "text2"
textme.text=text2.text
case "txtother"
textme.text=txtother.text
case "txtage"
textme.text=txtage.text
…………
end select
end sub
这段程序谁看了都要烦死了,有没有更好的办法
注:strText是字符串型,不可以改成对象型。
解决方案 »
- 请问怎么实现textbox获得焦点后白字蓝底?
- 一个shell语句的问题请教大家
- 关于UDP传输效率问题,请大家帮忙!
- vb与oracle的日期转换问题
- 请教,程序中要导电子表格,office2000要引用excel9.0库,这个引用能用于office2000 or xp吗?
- 这个类型是怎么定义的
- 请问用VB怎么才能把1个数据库里的表全部读入LISTBOX里?
- 我们应该开发什么类型的软件?
- VB数据库编程中的小问题?……小弟在线等待帮助!谢谢!急!
- 我要做一个控件,要求客户端自己选择所要的多个目录以及多个文件。可以么?
- 求教各位大侠!万分焦急!在线等候◎!!!
- 斑竹,斑竹,斑竹,斑竹,斑竹, 小弟求救!!!!!!!!!!(在线等待)
Dim ctl As Control,fFound as Boolean
For Each ctl In Controls
If ctl.Name=trim(strText) then
fFound=True
Exit For
end if
Next ctl
If fFound then
textme.text=CallByName(ctl,"Text",vbGet)
End if
end sub
on error resume next
textMe.Text = Me.Controls(strText).Text
end sub
select case strText
case text1
textme.text=strText.text
case text2
textme.text=strText.text
case txtother
textme.text=strText.text
case txtage
textme.text=strText.text
…………
end select
end sub
试试
参数类型能换吗?
1.能,我建议你把参数类型改为text
privante sub cmdGet(strText as text)
textme.text=strtext.text
end sub
2.不能,采用itpao(啊炮)的。