"脏QUOT;在表格上的标志 [英] "dirty" flag on a form
问题描述
我有几个非常非常大的表格,上面有几十个文本框。
我想要的是某种方式知道用户已编辑了一个文本框,所以
,如果他们关闭表格,我可以问他们是否愿意保存那里
更改。
有没有一种简单的方法可以做到这一点,或者我必须在每个文本中都有代码
box keypress(?)event?
>
谢谢
Hi,
I have some really, really large forms with dozens of text boxs.
What I want to do is somehow know that the user has edited a text box, so
that if they close the form, i can ask them if they would like to save there
changes.
Is there a simple way to do this, or do I have to have code in each text
boxes keypress(?) event ?
Thanks
推荐答案
澳大利亚,
为什么不做在关闭之前通过你所有的texbox循环看它
输入的东西。
在我看来很容易做到。
或者我不明白你?
Cor
Hi Aussie,
Why not just make a loop through all your texboxes before closing to see it
there is entered something.
Very easy to do in my opinion.
Or do I not understand you?
Cor
*" aussie rules" < AU *** @ home.com> scripsit:
* "aussie rules" <au***@home.com> scripsit:
我想知道用户已经编辑了一个文本框,所以如果他们关闭了表单,我可以问他们是否愿意保存
更改。
What I want to do is somehow know that the user has edited a text box, so
that if they close the form, i can ask them if they would like to save there
changes.
\\\
私有m_Dirty为布尔值
..
..
..
Public Sub TextBox_TextChanged(_
ByVal sender As Object,_
... _
)_
处理Me.TextBox1.TextChanged,Me.TextBox2.TextChanged,...
如果DirectCast(发件人,TextBox).TextLength> 0然后
m_Dirty =真
结束如果
结束子
..
..
..
如果m_Dirty那么
...
否则
...
结束如果
///
-
Herfried K 。瓦格纳[MVP]
< URL:http://dotnet.mvps.org/>
\\\
Private m_Dirty As Boolean
..
..
..
Public Sub TextBox_TextChanged( _
ByVal sender As Object, _
... _
) _
Handles Me.TextBox1.TextChanged, Me.TextBox2.TextChanged, ...
If DirectCast(sender, TextBox).TextLength > 0 Then
m_Dirty = True
End If
End Sub
..
..
..
If m_Dirty Then
...
Else
...
End If
///
--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
我想这可能是一个扩展器控制可能来的好例子
进场......
" Herfried K. Wagner [MVP]" <喜*************** @ gmx.at>在消息中写道
news:eZ ************** @ TK2MSFTNGP12.phx.gbl ...
I think maybe this is a good example of where an extender control might come
into play...
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:eZ**************@TK2MSFTNGP12.phx.gbl...
*" aussie rules" ; < AU *** @ home.com> scripsit:
* "aussie rules" <au***@home.com> scripsit:
我想知道的是,用户已经编辑了一个文本框,
,这样如果他们关闭表格,我可以问他们是否愿意节省
有变化。
What I want to do is somehow know that the user has edited a text box, so that if they close the form, i can ask them if they would like to save there changes.
\\\
Private m_Dirty As Boolean
。
。
。
Public Sub TextBox_TextChanged(_
ByVal sender As Object,_
... _
)_
处理Me.TextBox1.TextChanged,Me.TextBox2.TextChanged,...
如果是DirectCast(发件人,TextBox).TextLength> 0然后
m_Dirty = True
结束如果
结束子
。
。
。
如果m_Dirty那么
......
其他
...
结束如果
///
-
Herfried K. Wagner [MVP]
< URL:http://dotnet.mvps.org/>
\\\
Private m_Dirty As Boolean
.
.
.
Public Sub TextBox_TextChanged( _
ByVal sender As Object, _
... _
) _
Handles Me.TextBox1.TextChanged, Me.TextBox2.TextChanged, ...
If DirectCast(sender, TextBox).TextLength > 0 Then
m_Dirty = True
End If
End Sub
.
.
.
If m_Dirty Then
...
Else
...
End If
///
--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
这篇关于"脏QUOT;在表格上的标志的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!