有人可以帮助在 vb.net 中的 XTRAFORM 中迭代 DevExpress TextEdit 控件吗?
我实际上想要做的是通过使用 EditValue 和 OldEditValue 属性来拦截 FormClosing 事件中的任何值更改。
我可能需要告诉我我的控件包含在 XtraTab 和 XtraPanel 容器中。
以下是我尝试过的:
Public Function TextEditChangesOccured(frm As XtraForm) As Boolean
Dim result As Boolean
For Each ctrl As BaseEdit In frm.Controls
If TypeOf ctrl Is TextEdit Then
If ctrl.EditValue <> ctrl.OldEditValue Then
result = True
Else
result = False
End If
End If
Next
Return result
End Function
Private Sub MyXtraForm_FormClosing(sender As Object, e As FormClosingEventArgs) Handles MyBase.FormClosing
If TextEditChangesOccured(Me) Then
DevExpress.XtraEditors.XtraMessageBox.Show("Changes have occured!", My.Application.Info.AssemblyName, MessageBoxButtons.OK, MessageBoxIcon.Information)
End If
End Sub
但它说无法将 XtraTab 控件转换为 TextEdit 控件。
您的帮助将不胜感激。