|
-
Jul 13th, 2005, 09:27 AM
#1
Text Changed
Is there a way to have 1 procedure handle all the textchanged events on a certain form?
I have a boolean variable I am using to check whether the user has editted any information, and I need to set it to true if any of the textboxes get changed.
So is there any like global "text changed" event or anything?
-
Jul 13th, 2005, 09:32 AM
#2
Re: Text Changed
form has an event called Dirty (I think) that should tell you if the user has changed anything.
Alternatively, there is a tag property on the controls, whichc doesn't seems to do much, and you can shove the initial values into that as well as the control, then later, check the tags against the controls values to see if anything has changed.
Feeling like a fly on the inside of a closed window (Thunk!)
If I post a lot, it is because I am bored at work! ;D Or stuck...
* Anything I post can be only my opinion. Advice etc is up to you to persue...
-
Jul 13th, 2005, 09:39 AM
#3
Re: Text Changed
hrm, well dirty doesnt work....And using the tag property seems like it would be more coding than adding 6 textboxes textchanged events.
Thanks anyways
-
Jul 13th, 2005, 11:54 PM
#4
Fanatic Member
Re: Text Changed
This isn't exactly a global text changed event but it can be made to work as one. If you turn the forms KeyPreview value over to true then use the form_keypress form_keydown form_keyup subs you can tell when the person presses a key.
It would be up to you from there to determine if it was a change that you want to handle or not. To delve into that a little further lets say you were watching for changes in any textbox on your form you could do,
VB Code:
Sub Form_KeyUp(KeyCode As VbKeyCode) ' I know the sub isn't correct
If ActiveControl.Type = TextBox Then
'Handle the change
End If
End Sub
-
Jul 14th, 2005, 12:22 AM
#5
Re: Text Changed
Or you could in each of the events for the textboxes make another call to a central procedure to perform the common tsks.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|