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

Saving a form with scrollbars

Status
Not open for further replies.

sdocker

IS-IT--Management
Aug 12, 2010
218
GB
I am using VFP 9 on a Windows 8 64 bit platform.

When I make a change to a form and save it, then run it, I get a "Do you want to save Form xxx?" It doesn't matter if I use Ctrl-s, the toolbar icon, or the Save option on the file menu.
If the change was made to one of it's procedures it works fine. It only happens when I make a change to the from.

If I remove the scrollbars it works fine.

Any ideas why the scrollbar setting has this effect?

Sam
 
Please ignore the part about it working when I make a change to a procedure. IT DOESN'T WORK then either. I still get the "Save" promnpt.

Sorry,
Sam
 
Sam,

I'm a bit confused. You say "It only happens when I make a change to the from." What only happens?

You seem to be saying that it only prompts you to save the form if you make a change to the form. I can't think that's what you mean.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
mike,

Sorry for the confusion.

What I mean is...

If I make a change to the form, when I run it, interactively, I get prompted to save the form, even though I attempted to save it.
The prompt only appears if the scrollbars are active.

If the scrollbars are set to "none" this doesn't happen.

Sam
 
Sam,

Thanks for the clarification.

I've just done a quick test, and I'm not seeing this problem. Just to be clear, I did the following:

1. Created a form. Placed objects on it.

2. Set the form's Srollbars property to 2 (Vertical).

3. Saved and ran form.

4. Opened the form again in the Form Designer. Made no change to it.

5. Ran the form.

At step 5, I didn't see any prompt. In other words, it behaved as expected.

Sam, can you try repeating the above steps to see if you get the same result.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
Mike,
Can you try..

Open the form
Move an object
Save the form
Run the form

This sequence is whenI get the prompt.

Sam
 
Sam,

OK. You're right. I do see the prompt in those circumstances - but only if there is an object outside the viewport (in other words, only if the scrollbar is actually visible), which ties in with what you are seeeing.

By the way, my testing was with VFP 9.0 under XP, so this is not a Windows 8 or 64-bit issue. Also, I see the same behaviour with VFP 8.0.

Sorry I can't throw any light on the cause. Can anyone else come up with anything?

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
Mike,

I tried your steps and things worked as thay should have.

I have also noticed that if none of the controls on my form extend beyond the 480/640 boundaries, the screollbars turn off and I do not get a prompt.

Sam
 
Please pardon an obvious question, but your last statement ( my form extend beyond the 480/640 boundaries ) causes me to ask - You do know that you can change the Form boundary size if you want and/or need to?

VFP Development mode top menu - Tools - Options - Forms - Maximum Design Area.

Good Luck,
JRB-Bldr





 
JRB-Bldr,

I tried that. But it doesn't solve the problem of the SAVE prompt.

It appears that the existence of scrolbars causes the prompt.
What I was saying was that, as long as the controls are within the 480/640 boundaries, the scrollbars turn off, and the SAVE prompt doesn't appear.

Sam

 
Well, I can reproduce, but after answering Yes twice the form starts. That's just an annoyance, does it not work for you?
How about saving, closing and then starting the closed form via project manager?

JRB-Bldrs solution could work for you too, if you can design the form in a size you can view fully. The scrollbars then will appear for users having a smaller screen, but won't hinder you in developing for smaller screens.

If that's all not sufficient I don't know what would do, perhaps just setting Scrollbars at runtime in Load event instead.

Bye, Olaf.
 
Hi Olaf,

True, it is not much more than a nusiance, but I can't save the form unless I run it and answer "Yes" to the prompt. None of the other "Save" methods actually save the form.

There is too much data too keep on a small screen. I either have to scroll or use a page frame.

I will try initiating the scrolbars in the Load Event.

What puzzles me is that no one has come across this bug before.

Sam
 
>What puzzles me is that no one has come across this bug before.

Maybe because the typical developer has a large screen, or two, or three. For example one for the IDE, one for the application. And which such a setup you typically can design with a larger size than the end user has. And the only things I ever designed lengthier than a screen is, I put in grids, not into forms. What I mean is, that's typically repeating lists. If a form really has very many input controls then I rather use pageframes, and I think others use them, too.

I bet you have repeating portions in your form, too. put them in containers and compose your lengthy form at runtime, creating many containers either directly on the form, or into a grid. 1-column grid with dynamiccurrentcontrol set by the grid cursor you can have a container per record. And each container can contain a variety of controls. And there you have a layout you can design in portions.

Bye, Olaf.
 
Olaf,

The form I am working with has over 60 textboxes and all the data comes from a single record. There is just so much that can fit on a screen. It collects data for a tax form, and it looks amateurish when it's on a page frame since there are no logical sections (portions) to the page.

BTW, I was not successful in settings the scroll bars in the load event. It is read only at runtime.

Sam
 
I don't know the form, so I can't say something about it, but I know forms in general and in general they don't look like textboxes randomly scattered on the sheet of paper. You may not have the portions you think of, but lines will look similar, you will have lines with label+textbox, or label+textbox+label+textbox. You can still put these into containers and let a grid display them. The table having the 60 fields doen't need to be the one driving the grid. You can bind the grid to a cursor with eg 60 records with nothing in them, this just creates 60 grid lines. A good content of that cursor would be the name of a container class to use for that grid line, and what fields of your other table to bind in this container. And then you can bind the container to the fields of your main table. The grid won't move from that record, because it's driven by the meta data cursor and not your data table. It's an unusal usage of the grid, but it works.

For example I used this in shrinked down version with always using the same container class, and this container would display a record in two lines instead of one.

Turn off the grid lines and headers and recordmark, etc and you only have the grid scroll bar(s) and it will look as it should.

Bye, Olaf.
 
I think this point about the size of the form and the number of controls is a digression. The point is that the prompt appears whenever the scroll bars are visible. I've reproduced the behaviour with a small form with just three controls.

My advice would be to forget the whole thing. Just click the Yes button and be done with it. Even if you did that a dozen times a day, it wouldn't take any longer than the time you'd otherwise spend looking for a solution.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
> Even if you did that a dozen times a day, it wouldn't take any longer than the time you'd otherwise spend looking for a solution.

I agree.

Even if you're really concerened about that bug, it's too late. Only someone havng subscribed the extended hotfix support for VFP9 could now order a bugfix, which would also be charged for. VFP9 is in the last support phase of the Microsoft support lifecycle.

There are only complicated solution to avoind the problem. I only know this topic from you, noone else has reported that in my 10 years of supporting collegues and the community, I don't know a fix or workaround that would be easier than pressing Yes once more than usual...

Bye, Olaf.

 
Mike & Olaf,

I agree with both of you.


Olaf,
You have intrigued me with your suggestions. I am not vey familiar with using grids, but I will definitely give it a try. I have attached a link to the form I was referring to, so you can fully understand what I am working with.

Thank you both for going the extra step.

Sam
 
 http://www.ussi-md.com/TekTips/BalanceSheet.pdf
By the way, one reason that we've not come across this before is that it might only apply in the form designer, not the class designer. In a recent project, I had a lot of forms with scrollbars, and I never remember seeing this behaviour in many months of development. But all the forms were VCX-based, not SCX-based, which might explain it.

I'm not saying the above is definitely true. It's just my guess as to why some of us might not have seen the problem before.

Mike



__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
I looked at your PDF, this looks even grid friendlier than I thought it would.

You can put the head about Beginning of Period and End of Period in form controls and the four columns beneath it could be put into a grid. Stretch the grid to the left and you can have the line captions as column0 before those 4 columns. Well, so let the grid have 5 columns.

To put all this data into one record is not very clever, but you can still do it after a user has enetered the 24 records you just scan through them and replace the main tqable fields.

Bye, Olaf.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top