Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Checkboxes wont stay where I put them.

Status
Not open for further replies.

JimSeason

Programmer
Nov 24, 2006
15
US
In VFP 8 and now in VFP 9 SP2 when I place a checkbox at a specific location on a form, sometimes, when I come back to the form later, the checkbox is in a different location. If I have several checkboxes on the form sometimes, more than one checkbox has moved to a different location.

If I then click on the checkbox while editing the form and then press an arrow key the checkbox will "jump" back to the original position I assigned it.

When I run the form the checkbox remains in the wrong position.

I've tried…

1) Deleting the checkbox, running project cleanup, and placing a new checkbox on the form, but if I save and/or run the form, the checkbox has moved back to the same wrong position as before.

2) Deleting the checkbox, quitting VFP, restarting VFP, adding the checkbox back, quitting VFP, restarting VFP, and the checkbox has moved back to the same wrong position.

It makes me feel like "Curly" of the Three Stooges when something unwanted keeps happening to him no matter what he does to try and stop it.

Has anyone ran into this one? Has anyone got an answer as to how to fix this?

Nuk, nuk, nuk...

Thanks

Jim

If you always do what you've always done, you'll always get what you've always got.
 
Jim

Yes I have seen this. I now do not put a caption on the checkbox but add a label along side.
 
StirFry,

Thanks for the tip. However, it didn't work. But the good news is I found the cure!

I have no idea why this works, but it does.

1) Click on the checkbox while editing your form.
2) In the properties window go to the Width property.
3) What ever value is in the width property if it isn't in bold face, type in the same value, and now it's in bold face because it is no longer the "Default", but the number you typed in.

Now the form works and the checkbox stays put.

Tis a strange world we live in.

Jim

If you always do what you've always done, you'll always get what you've always got.
 
I've had this happen with labels when their are set to autosize.

I'd gotten into the habit of:
turn on autosize on to set the size then off.
IN some cases the lable would still shift so I also shift the label back and forth by 1 pixel using the keyboard.

Since I started doing this with labels and checkboxes they always stay put and stay the right size.


Alan
 
I too have seen this.

Normally it happens if I have the text alignment set one way and then change it - without moving the item. It then continues to reference the top left of the control, but realigns it when the form is redrawn...

A little niggle that catches me out from time to time!

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.
 
Labels and CheckBoxes won’t stay put.

Ok everybody, I think I've got the answer.

Tested on VFP 8 and 9.

First let me thank all of you for your time and suggestions. I have tried them all and sometimes they work and sometimes they don't. Who knows why?

But, I've stumbled across what I believe is the answer. I've been using it with Labels and CheckBoxes that won't stay put for a couple of months now and so far it has always worked.

First, setting the AutoSize property to .T. seems to initiate the problem when it occurs. Note: setting AutoSize back to .F. doesn’t solve the problem once the problem starts.

Solution. After Autosizing a Label or CheckBox, make note of the WIDTH property (say it’s 103). Turn Autosize off. Go back to the WIDTH property and even if the WIDTH still is 103 reenter 103. (After doing so the number 103 should now be in BoldFace.) So far, this has worked every time for me and the Labels and CheckBoxes stay put.

Good luck out there.

Jim

I'm not satisfied until you're not satisfied.

(A paraphrase of DeMotivators)
 
A slightly simpler approach, I think.

Set AutoSize to .T.
Go to Width and hit Enter. That bolds the width value.
Set AutoSize to .F.

I've been dealing with this on a different front.

Tamar
 
Tamar,

Thanks. I've already tried it and it works. Simpler is better(er).

Jim

I'm not satisfied until you're not satisfied.

(A paraphrase of DeMotivators)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top