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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Optiongroup1.option1 - images nightmare!

Status
Not open for further replies.

MitchUK

Programmer
Jan 17, 2001
22
GB
MitchUK back with another nightmare : >:-<

Have &quot;optiongroup&quot; with a selection of buttons &quot;style 1.graphical&quot; (in this case for database navigation).

I have set the PICTURE property to &quot;Image1.bmp&quot; and the DISABLED PICTURE to &quot;image2.bmp&quot;.

HOWEVER when the option buttons are disabled the images do not always change the image but just disable the buttons.

MORE sometimes the images are correct at the start, and other times not!

No standard can be found for these errors yet!

Any ideas?
THX in advance as per. :) Have knowledge, lack patience. >:-<
MitchBsc@yahoo.co.uk
 
Mitch,
I tried a sample in VFP 6.0 (SP4) and it seems to work as expected. Two things to be aware of:
1) Make sure you set the option button Caption to a null string [it'll show as (None)].
2) You've got to disable/enable the individual option buttons to get the proper effect - not just the option group.

Rick
 
RGBean,

I have a &quot;setnavigator&quot; function that, when BOF is reached Thisform.topmode=.t. and therefore, first and prior buttons are disabled (and vice versa for eof). In between records (i.e. >1 !eof) all buttons are enabled.

I don't disable the option group.

Is it calling this other function that is causing the error?? (p.s. Caption is already NONE) Have knowledge, lack patience. >:-<
MitchBsc@yahoo.co.uk
 
Mitch,
If you aren't running VFP 6.0 SP4, have you tried doing a Thisform.optiongroup1.option1.refresh() after you changed the enabled state of the option button? (I tried it again using your new information, and it works for me.)

Rick
 
RG,

Yes, running VFP6.0 sp4, refresh all forms currently used by package after every option &quot;click&quot; using the following :

local lnCounter

IF _screen.formcount > 0
FOR lnCounter = 1 TO _screen.formcount
IF PEMSTATUS(_SCREEN.FORMS[lnCounter], &quot;REFRESH&quot;, 5)
_SCREEN.FORMS[lnCounter].REFRESH()
ENDIF
ENDFOR
ENDIF

Does this not constitue refreshing the optiongroup??

even more why does this not explain the fact that some imes when the application starts, the buttons aren't set?? Have knowledge, lack patience. >:-<
MitchBsc@yahoo.co.uk
 
Have worked out when the buttons work and when they don't.

as you can see by the previous messages, I have the disabledpicture, picture properties pointing to a fixed directory for now.

when you reassign the locations (i.e. change the name/path/type) it works, then the next time you run the application, the buttons stop changing!

I tried changing from .JPG to .BMP and the buttons worked. I exited the program and the problem started again.

WHAT IS GOING ON? Have knowledge, lack patience. >:-<
MitchBsc@yahoo.co.uk
 
PMFJI, but here are my thoughts:

1. A side bar, but why are you refreshing every open form with each button click? Are other forms dependant upon the state of the option button? You may want to change it to a simple: THISFORM.Refresh()

2. In the form that contains the option button, add an explicit call to the option buttons refresh method. For Instance,
PROCEDURE MyForm.Refresh()
THIS.MyOptionGroup.MyOption1.Refresh()
THIS.MyOptionGroup.MyOption2.Refresh()
ENDPROC

3. If you are programmatically changing the picture properties, SWAG, but try assigning an empty string to the property prior to assigning the new images path. For Instance:
THIS.DisabledPicture=&quot;&quot;
THIS.DisabledPicture=&quot;C:\MyNewPic.jpg&quot; Jon Hawkins

The World Is Headed For Mutiny,
When All We Want Is Unity. - Creed
 
Jon,

in answer (pardoned)

1. Had problems with refreshing forms previously, that was the best way round it as there are many forms in the application but only one or two are in use at any one time.
see thread184-49772

2. Now if the entire form is refreshed, doesn't that autromatically refresh all controls on that form?? Most other developnent tools do

3.sounds good, i'll give it a go.

Thanx Have knowledge, lack patience. >:-<
MitchBsc@yahoo.co.uk
 
Hello.

Try a DOEVENTS() after the programatically change of the image. Sometimes (and more often on slow machines or buggy video drivers) Visual FoxPro can't refresh the screen correctly.

Hope this helps
Grigore Dolghin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top