Private strBookID As String
Private strBookName As String
Private strPublisher As String
Private strPublishDate As String
Private strAuthor As String
Private strPurchaseDate As String
Private strPrice As String
'以上变量已经初始化,在这里省略....Private Sub Judgment() Dim ctrCurrent As Control
Dim strTextName As String
Dim strString As String
For Each ctrCurrent In Me.Controls
If TypeName(ctrCurrent) = "TextBox" Then
strString = strChange(ctrCurrent.Name)
If ctrCurrent.Text <> strString Then '
cmdOk.Enabled = True
End If
End If
Next
End Sub
Private Function strChange(ByVal strConName As String) As String strChange = Replace(strConName, "txt", "str", compare:=vbBinaryCompare)
End Function我的控件名除了前面的"txt"与上面的变量不同,其他的方都相同,如:
控件名: txtBookID
变量名: strBookID
我现在已经用strChange函数把txt替换成str了.(strString变量),但它只是个字符串"strBookID".怎样才能将上面的strString里的内容=strBookID的内容呢?
Private strBookName As String
Private strPublisher As String
Private strPublishDate As String
Private strAuthor As String
Private strPurchaseDate As String
Private strPrice As String
'以上变量已经初始化,在这里省略....Private Sub Judgment() Dim ctrCurrent As Control
Dim strTextName As String
Dim strString As String
For Each ctrCurrent In Me.Controls
If TypeName(ctrCurrent) = "TextBox" Then
strString = strChange(ctrCurrent.Name)
If ctrCurrent.Text <> strString Then '
cmdOk.Enabled = True
End If
End If
Next
End Sub
Private Function strChange(ByVal strConName As String) As String strChange = Replace(strConName, "txt", "str", compare:=vbBinaryCompare)
End Function我的控件名除了前面的"txt"与上面的变量不同,其他的方都相同,如:
控件名: txtBookID
变量名: strBookID
我现在已经用strChange函数把txt替换成str了.(strString变量),但它只是个字符串"strBookID".怎样才能将上面的strString里的内容=strBookID的内容呢?
解决方案 »
- 去掉移动窗体时显示的虚线框
- 我现在的datagrid已经有内容,但是怎么倒到excel呢?
- 高手请入 vb读取指定网页的新闻内容和发布日期并存入数据库 网页地址是定的
- 刚学vb,大家帮我看看一个问题啊,先谢谢了,(在线等。。急!!!)
- 请问一下,如何用WebBrowser显示,用DHTML做好的动态内容。最好有例子,请大家帮忙看一下。
- 来看这个有关dataenvironment的问题
- 关于字符连接问题!!&不管用
- Option Explicit 是什么意思?什么时候需要用?
- 请问哪有关于tabstrip实例或者是原码
- 关于DataGrid及ComBox的几个问题?
- 哪位仁兄有VB6.0日文版?
- 在Addin工程里,如何获得Font属性的下一级属性...
control.name is readonly