Checkbox does not want to be disabled

When I tried my application on a specific computer, I got a white screen saying that an illegal operation occured. Even if on my computer it works fine.

I did some test and by putting a msgbox between each line, I figured out which line causes this error.
The line is :
chkRemoved.Enabled = False

where chkRemoved is a checkbox

Can anyone tell me why disabling a checkbox would cause an error and how can I work around this?

I think maybe it has something to do with the fact that my computer is under Windows 2000 and the one that is causing this problem is under Windows 95.
I'm using VB6 with SP5 in case it would change something.
PennywisdomAsked:
Who is Participating?
 
rspahitzCommented:
I've found that some objects crash when certain combinations are applied.  For example, if you try to set a textbox's alignment when the textbox is disabled, you get a serious error that takes down your IDE without warning.  (Microsoft acknowledged this bug when I sent it to them.)

I don't think that's the problem here, but I'd check:

1) Is chkRemoved a standard checkbox, or is it a third-party checkbox?
2) Is the checkbox already disabled?
3) Is the checkbox's container (form/frame/picturebox) already disabled?
4) If you add (not copy/paste) a new checkbox and apply the same command at the same spot (just before where the error occurs) do you get the same result, or is it only for this particular object?  If just for that object, start comparing setting and apply them to the new checkbox until they're the same.
0
 
Dave_GreeneCommented:
How are you getting your application to the other computer?  Setup program?  Running it in the IDE?
0
 
nomulapCommented:
See if the font size setting on the client machine is same as your's. This will cause weird problems sometimes.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
PennywisdomAuthor Commented:
I installed it using a setup program made with the Package and Deployement wizard that comes with VB.

What is IDE?
0
 
PennywisdomAuthor Commented:
nomulap :

Which font size should I compare? The font of the checbox with window text font? My windowtext font with the other computer's?
0
 
nomulapCommented:
Windows Font Size. Go to Control Panel, double click Display click on Settings tab and check the Font Size.
0
 
PennywisdomAuthor Commented:
The font size are the same on both computers
0
 
Dave_GreeneCommented:
IDE = Your development environment...

still thinking on the problem...
0
 
gbarenCommented:
Change your video driver back to standard VGA and try your app. If the problem goes away, update your video driver.
0
 
Hornet241Commented:
What event is this in?

     chkRemoved.Enabled = False

0
 
Valliappan ANSenior Tech ConsultantCommented:
Did you try the samething in some other computer, and you get the same error?
0
 
PennywisdomAuthor Commented:
Hornet241:
It's in a change event of a textbox

rspahitz:
1) it's a standard checkbox
2) the checkbox is not already disabled
3) it's container is not disabled
4) i'll do some test and i'll get back to you

valli_an:
I tried it on 3 computers and 2 of them gave me the error
0
 
Valliappan ANSenior Tech ConsultantCommented:
Hope the checkbox is Visible also.
0
 
PennywisdomAuthor Commented:
I tried to add a new checkbox (Check1) a command button that toggles the Enabled property.
When the Checkbox has a caption it crashes but when the caption is empty it works ok (I think it has soething to do with my checkbox being 195x195 and having no place to display the caption).

So I tried removing the caption of chkRemoved but it still crashes.
After this I deleted chkRemoved and I renamed Check1 to chkRemoved without changing anything else and it still crashes.

Buy the way my checkbox is visible
0
 
rspahitzCommented:
All this sounds like a problem with the checkbox, which I think is defined in the VB runtime library: MSVBVM60.dll  You may want to replace that, or at least check its date and size.

Meanwhile, if you can replicate the error in your design environment, I'd say:
--Start with a fresh project and see if the checkbox object gives you any problems.
--If not, try to copy the object from the faulty project and paste it into the new project.
--If not, copy/paste all the code and objects and see if it crashes.
0
 
Valliappan ANSenior Tech ConsultantCommented:
Can you put your source code? That, we could try it.

Cheers.
0
 
PennywisdomAuthor Commented:
By adding new checkboxes and changing there Enabled property I found out that it was when the checkbox add a caption that the bug occured.

After discovering this I removed the caption from my original checkbox but I forgot that a part of my code changed the caption while loading the form. Since my check box is only big enought to see the white box, I did not see that the caption was there.

So I removed the part that changed the caption and now it works fine.
0
 
rspahitzCommented:
I'm glad you figured it out, but I still can't figure out why the checkbox caption would cause problems.

Anyway, at least you're through this issue!
0
 
PennywisdomAuthor Commented:
When a checkbox is disabled the text changes color to show that it's no longer available.
To do this it's likely that the code changes the video memory even if the caption is not visible. So he would change the video memory at a place which is not associated with the checkbox. In other words he tries to write in a memory spot that is read-only to him.
This would cause an illegal operation.

At least that's the best explaination that I can think of.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.