INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

FoxPro Form Modal not performing modally

FoxPro Form Modal not performing modally

(OP)
Just discovered why some FoxPro forms won't behave modally even when property windowtype is set to modal (1).

I had copied a previous form that had an object which was part of a class library. Once that object was deleted, the form behaved in a modal state the way advertised. It took a while to find that one!

RE: FoxPro Form Modal not performing modally

I'm sorry, but I don't get it. Surely, every object that you place on a form is "part of a class library" (at least, every object that you place interactively). Wny would that change a modal form into a modeless form?

To be precise, the object is based on a class, which is a member of a class library.

Even if you are adding the object programmatically, I still don't get it.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads

RE: FoxPro Form Modal not performing modally

The only explanation I can think of is if the object itself changes the WindowType for some reason. That's perfectly possible, and it would explain the behaviour you are seeing, but it would be unsual for an object to do that.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads

RE: FoxPro Form Modal not performing modally

Yes, to support Mikes thoughts, the only modal forms never behaving modal are top level forms. By definition. Inner objects don't modify the modality.
The WindowType property is defined to be modifably at design AND run time, but there is a limit to this. The init of a class on your form would need to do that before the form init, I assume. The last chance should be before the form shows, really, after that the WindowType will not accept changes. I think you can change the modality during hide before next show of a form. Christof Wollenhaupt has shown something along that lines in his blog.

Anyway, it never is just because some control on it is from a class library. That's ridiculous. You're suggesting you can't use forms with any controls on it, which are non native controls but come from class libraries: I can assure you a magnitude of 1000 users have used such type of forms modal and non modal as expected for a magnitude of 15 years and so surely alone from me, the concept of control classes not having that impact is proven many million times.

There must be some detail you didn't dive into, it's not happening due to the shallow look about the situation you have observed.

Bye, Olaf.

RE: FoxPro Form Modal not performing modally

To make a small correction to what I said earlier: every object that you place on a form is "part of a class library".

I had forgotten about the native objects. I suppose that's because I almost never place those on forms. But that doesn't alter the main point. As Olaf pointed out, the vast majority of developers use objects based on classes in class libraries, and have done for many years, and it would be inconceivable that nobody had ever noticed this behaviour before.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close