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

Text Controls Not Editable

Status
Not open for further replies.

stanlyn

Programmer
Sep 3, 2003
945
US
Hi,

I created a form via the vfp9 wizard. I then created a non-wizard form and copied the text controls to the non-wizard form. Now the controls are behaving as if they are read only, but they are not. I've searched everywhere for property or anything that would cause this.

Any ideas?

Thanks, Stanley

 
The controls in the wizard-generated form are based on classes in special wizard-specific class libraries, and are not intended to be used on other forms. For example, if you chose the embossed style in the wizard, the controls would be based on classes in WIZEMBSS.VCX, and will only work on forms based on the EMBOSSEDFORM class.

The best advice is never to use wizard-generated forms. They are fine for knocking up quick stand-alone forms for your internal use, but the form wizard is not something most of us would use in real applications.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Hi Mike,

Normally I do as you suggested and stay away from wizard based anything as the code they generate requires one to to be a wizard/expert. Most of the code they generate is far beyond my skills.

I was thinking I had done this before without having the "cannot edit" issue, as this is the first time in 17 years that I've seen this.

So, is there any way to maybe hack something to fix this? There are a lot of controls but only limited to a single form.

Thanks,
Stanley


 
Also I've opened the WIZEMBSS.VCX library which is the one these controls inherit from and also see nothing that should stop editing. These controls were copied to a non-wizard form.

Thanks, Stanley

 
While running the form, see if the control is ReadOnly, or if the table is open as ReadOnly.

To see if the control is Readonly, you Issue "Do form Yourform Name test", then you can check ?test.yourcontrol.readonly from the command window.

Similarly, to check if the table is readonly, you can issue ?IsReadOnly('yourtable').

Anyway, you will have to try to debug this, which can be time consuming, but very educational.
 
Thanks Mike and tbleken,

I got it fixed. It was a refresh inside a call that an interactivechange event was doing. It took a block by block stepping to find it.

Anyway, thanks again,
Stanley
 
Stanley, good to hear you solved the problem. It can be difficult to debug wizard-generated code, not least because it's badly commented and it doesn't always seeem to make sense.

A colleague once had a really hard-to-find bug in his application. I don't remember the details, but it was something to do with record locking. He finally tracked it to an unexpected SET REPROCESS command in a wizard control - in a completely different bit of the application. The wizard was changing the reprocess interval - for no apparant reason - and was failing to set it back again. It cost my colleage half a day to solve that one.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Yeah, the wizard classes are actually usable but ONLY if you completely figure out how they work and YOU always work THEIR way.

As soon as you want to do something your own way you'll be playing a mix-and-match game that's just not a good game to play.

But that can be said of any framework. In for an inch, in for a mile.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top