In my application, i have put a question on form closing if the user wants to save the changes?. But right now, i have just put it in default whether they make changes or not.
I thought of prompting it on text change.. but the text automatically changes on load as it retrieves data from sql server. is there a way to rectify this?
choosechrist 0 Newbie Poster
Recommended Answers
Jump to PostAdd two Booleans to your Global Variables set to False
Dim loaded As Boolean = False Dim txtChanged As Boolean = False
Create a Sub to handle when any of the Text Boxes have a Text Changed event, say set a flag to true.
Jump to PostOnce the form has loaded and the text fields have been populated, you could loop through the text boxes and make a copy of the contained text in the Tag property of each control. Of form close you could compare the values of TextBox#.Text to TextBox#.Tag to look for changes.
Jump to PostYou will have to loop through each GroupBox just as you did with the form1 ---> "Me"
Jump to PostThat's why I suggested saving the original string in the Tag property. You don't have to worry about bogus Changed events like when the value is originally set, or if the user modifies a field, then undoes the mod. As long as the text is the same at the start …
All 15 Replies
M.Waqas Aslam 67 Posting Pro in Training Featured Poster
choosechrist 0 Newbie Poster
M.Waqas Aslam 67 Posting Pro in Training Featured Poster
Phasma 11 Junior Poster in Training
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster
choosechrist 0 Newbie Poster
Phasma 11 Junior Poster in Training
choosechrist commented: helpful +1
choosechrist 0 Newbie Poster
choosechrist 0 Newbie Poster
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster
choosechrist 0 Newbie Poster
codeorder 197 Nearly a Posting Virtuoso
choosechrist 0 Newbie Poster
codeorder 197 Nearly a Posting Virtuoso
pROKO -2 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.