(RESOLVED) CheckBox Wierdness .Value Not Availbale
ok i have been trying to save the valuer of a checkbox being 0 1 or 2 0 being clear, 1 being checked and 2 being checked and grey! howver the checkbox.value member seems to have vanished anyone got a clue whats gone wrong i have enclosed a an attachment for the code and the missing option!
Last edited by Cenobitez; Jan 4th, 2004 at 03:16 PM.
Ive no idea what the problem is when i open a fresh project the .value option is there yet in the Trivia program i am using i cant get it to appear anywhere!
Martin i was under the impression that 0,1,2 was faster ?
I have always used the integer value since thats that the IDE uses
I think im just gonna have to create the form in another project and try to transfer it overor use Yes and No option boxes instead!
Il leave this as unresolved until i figure something out!
It really doesn't matter which is faster unless you are in a routine that evaluates many checkboxes. The important thing is maintenance and it's much easier to maintain a program which says If Check1.Value = vbGrayed then it is one that says If Check1.Value = 2.
If for some reason you can't or don't want to post your project then at least show us what any one of your checkbox's Click event looks like. It should be something like
Private Sub Check1_Click()
and not
Private Sub Check1_Click(Index As Integer)
If it looks like the latter then you are working with a control array.
this is the form the whole project is rather large at 450KB ZIPPED mainly due to me using "universale modules" ie the same modules thruought a dozen programs so that when i upgrade one i upgrade the rest since some of the methods need upgrading!
that form was wrote in a fresh project and worked fine, altho n need to fixe the form load so it ddesent erase my default option but il fix then when i have this issue fixed!
As u can see it works fine and code is exact and "maintainable"
As soon as i add this into my other project the methods and object members change and the .value vanishes!
On a side note, like many programmers im kinda stuck in my ways over the vb intrinsic values, like vbminimized and such i prefer in larger application and infact any application to use the relevant number as it makes sense to me
I am however constantly updating my coding conventions so i may lter
Works ok on its own just not in my other project, i figure i must have declared something or changed a setting somewhere its not major deal, il use option boxes for now!
at least i have an alternative on this one!
Im thinking the same thing that im using it elsewhere, but i dont know why my error traps nor windows error traps have spotted it as i get no error it just dont work!
This is like when i had a service pack install mess up and half the control wouldnt work and otherhalf said i had no licence to use in designed view i have to use an MS tool called CLIClient i think oh well this program is nearly finished so a simple optionbox control array will do
Last edited by Cenobitez; Jan 3rd, 2004 at 09:09 PM.
Have you followed up om Merri's suggestion and look for all occurrences of chkKWEnabled. I've also sent you my email address if you want to send me the project.
im just gonna chalk this project up once i implement the saved values to variables and make them accessable to the program this project is done, then il work on stripping it to find the issue!
I have just searched for it and i have 3 occurances of the chkKWEnabled, one is a Constant which is my default value for another checkbox called the same, but its in anothr form! and the one im working on now!
I dont want to get side tracked now id sooner get the app to a "finished" state then "tweaking and refinement is eternal" il find the issue, i just added this URL to my comments so l find it
Martin if you dont mind id rather not send the code as its messy very messy with comments everywhere and old commented code, and various methods of doing the same thing when i have updated and just commented the old out!, not the kinda code i like to give out, soon as its acceptably finished and i clean it up to post on planetsourcecode il be more than happy to send it if i still have the same fault!
Originally posted by Cenobitez ...I have just searched for it and i have 3 occurances of the chkKWEnabled, one is a Constant which is my default value for another checkbox called the same, but its in anothr form! and the one im working on now!...
I'm sure that that is your problem. Change two of the three names so that all three are unique.
as they are private not public and on different forms they shouldnt interfere but i believe i found the problem!
Global chkKWEEnabled As New Frame
this was in the midded of a module called "RedunExps" which is where i put failed and/or redundant code with loads of comments as to why its no longer in use and what sub super seeded it, i like to see where i came from, and about 4 lines was uncommented including the global!
I missed this in my search mainly due it being like 3am where i am in England and not noticing is wasnt commented out when the whole 50kb module was My Bad!
I believe i was going to "manually" and on the go create the settings and options box as i have New Frame, New Label New Blah thru out, i do rmember that i was unsucsessful at this on other occasions!
Took me about 1 minute to find after some sleep and coffeine!
I'm glad you resolved your problem. Let me suggest that you use a more standard naming convention where a frame would be called fraSomething, and a constant would be in all caps.