I am looking for a way to detect when a control has been changed from its initial value, also for it to detect if it is changed back again to that original value. This is to be used to set the enabled property of my Apply Button?
Also, in order for it to "change back to its original value", that value needs to be maintained somewhere so it knows what to change back to. How are you doing that?
The controls used are:-
TextBox's, ComboBox's, CheckBox's, ListBox's, OptionButton's
I have got the initial values in a UDT > 'User.Settings' which are initialy populated from a database.
I just didn't want to really put the relevant code into all the change/click events as there are between 50 - 150 different options, so was wondering if it was possable to have an external sub to do the checking? I have already made as many as i can into Control Arrays to save code.
To check if a control has changed, you need to have some kind of boolean flag.
In the Click/Change event set the flag and in your 'cmdApply' set the default values if needed.
sure that would be great. After all Oz is a bit bright for me at this time of the year.
I have got a VERY basic idea for one already but maybe there might be something you have got there to make things a bit easier in the long run.
Oh Well, I was just hoping that i could mimic windows settings where you only need the apply button when there is actually a change to make.
Maybe i should just move to .net I am told that has the ability already built in.
Is there no way of calling all of the control_Change/Click Subs from one place?
In VB6, no. In VB.Net it's trivial.
The most difficult part of developing a program is understanding the problem.
The second most difficult part is deciding how you're going to solve the problem.
Actually writing the program (translating your solution into some computer language) is the easiest part.
Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read. Please Help Us To Save Ana
Hi Again, All went rather smoothly. Brilliant. I should have thought of that myself, not too long ago i use a similar method to mimic .net base calsses and derived classes.
Just one thing though, If the controls are part of a control array it don't work properly, i get an error saying the event is not set correctly. I am presuming that this is because for a control array there is the (Index as Integer) on the event calls as well.
How should i go about adding this availability for the controls aswell?
I don't know how to include control arrays in this too (and I haven't got the time to do the research to find out). I guess that's why they're no control arrays in .Net