M
magical_li
Unregistered / Unconfirmed
GUEST, unregistred user!
如何在delphi中定义控件明类型的变量,可也用(变量名.控件属性)调用变量中存储的控件属性或过程。
在VB中只要定义 Object 类型就可以了,
如定义函数:
Function CheckInputSpace(strAlarm As String, objCheckedObject As Object, iError As Integer) As Integer
If (objCheckedObject.Text = "" And iError <> 1 then
MsgBox "请您输入“"
&
strAlarm &
"”!", vbOKOnly, "输入错误"
objCheckedObject.SetFocus
CheckInputSpace = 1
else
If (InStr(1, objCheckedObject.Text, "
", vbTextCompare) > 0) And iError <> 1 then
MsgBox "请不要在“"
&
strAlarm &
"”栏中输入空格!", vbOKOnly, "输入错误"
objCheckedObject.SetFocus
CheckInputSpace = 1
else
CheckInputSpace = 0
End If
End If
End Function
调用时:CheckInputSpace("参数代码", Me.csdm, iCommitError)
在delphi 中如何实现???
小弟是初学者,还请各位大哥指点。第一次提问,如有不到的请原谅
在VB中只要定义 Object 类型就可以了,
如定义函数:
Function CheckInputSpace(strAlarm As String, objCheckedObject As Object, iError As Integer) As Integer
If (objCheckedObject.Text = "" And iError <> 1 then
MsgBox "请您输入“"
&
strAlarm &
"”!", vbOKOnly, "输入错误"
objCheckedObject.SetFocus
CheckInputSpace = 1
else
If (InStr(1, objCheckedObject.Text, "
", vbTextCompare) > 0) And iError <> 1 then
MsgBox "请不要在“"
&
strAlarm &
"”栏中输入空格!", vbOKOnly, "输入错误"
objCheckedObject.SetFocus
CheckInputSpace = 1
else
CheckInputSpace = 0
End If
End If
End Function
调用时:CheckInputSpace("参数代码", Me.csdm, iCommitError)
在delphi 中如何实现???
小弟是初学者,还请各位大哥指点。第一次提问,如有不到的请原谅