?
Solved

Odd modal form behaviour

Posted on 2005-05-02
11
Medium Priority
?
625 Views
Last Modified: 2008-02-01
Hi Experts

A curious question that I wonder if somebody has encountered before.

I have a normal app (D7).

Create a new Project with two forms Form1 and Form2

Make Form1 your startup form

On Form1 place a button.

Under the button put this code

Form2.showmodal:

Run the project and click the button, Form2 show modally.

Everything looks fine.

Now I have a cheap mouse with a neat menu system.  I click a button on the side and a menu pops up.

Funny thing happens, in my Delphi project, my modal form ducks behind the main form and the main form is inactive.

I have probably a hundred apps on my PC and don't have this problem with any other apps.

The solution is easy - get a new mouse?

But here's the problem, what if my clients have the same problem with another mouse?

Anybody got any idea what's happening?

The app exhibits the same behaviour on NT and Win2000


Voodooman
0
Comment
Question by:Voodooman
9 Comments
 
LVL 27

Expert Comment

by:kretzschmar
ID: 13907861
you have already posted the same question below.

i can't reproduce your problem, maybe its a feature, not a bug.
sorry, can't help

meikl ;-)
0
 
LVL 10

Expert Comment

by:_Katka_
ID: 13908122
Hi, try setting Form2's property FormStyle:=fsStayOnTop;

maybe it should help, regards,
Kate
0
 
LVL 5

Author Comment

by:Voodooman
ID: 13908138

Hi Meikl

Yes I did post the problem before but it did not appear in the list for some reason and so I had no responses.

I posted to support about the 'no show' so maybe they fixed the reason it was not showing.

This is the reason I posted again as I figured their was some problem with my first question.

Maybe it's a problem with the mouse driver, but I do not have this problem with any other software only my own software developed with D7.

Its a Borland bug of some kind (I think so anyway).

As you can see I can reproduce the probelm on 2 x machines by simply creating a new project with just two forms and standard controls.

Strange but true

Voodooman
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 27

Expert Comment

by:kretzschmar
ID: 13908158
>Its a Borland bug of some kind (I think so anyway).
well, could be, d3 had a bug with the mousewheel (with a specific driver (logitech i guess)),
so maybe this a borland bug too

will try a second setup on a different machine

meikl ;-)
0
 
LVL 5

Author Comment

by:Voodooman
ID: 13908280

Thanks Meikl

I have had problems in the past similar to this (only with Delphi D7).

Before I had problems with other application forms getting in between my main form and modal forms.

In my app I made the main form the splash.

Then I hid the splash (main form) and showed my 'main working screen'.

This caused all kinds of problems

It would happen like this.

User cliks 'add rec' or something and I

1) Hide the main screen (remember this is not the main Delphi form)
2) show the 'addrec form' modally
4) show a form modally over the 'addrec form', 'SelectClientForm'

In this scenario if I went to check my E-Mail and after clicked on the toolbar Icon to swap to my app I would retrieve the last modal form 'SelectClientForm' but the 'addrecform' would not be visible behind it as expected, only the Outlook Screen would be visible.

The project was dropped so I didn't experiment anyfurther.

However I have just looked at another project completed some months ago and that exhibits the same behaviour that I am experiencing now!!!!!!!!

I press button 5 to access my mouse menu 'off my modal form' and my modal form drops behind my main delphi form.  

If I select any item off the mouse menu the form reappears, if I click away from the mousemenu to cancel it the form remains hidden behind my main form.

Voodooman



The
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 13915431
sorry, got no time yesterday, will try this evening
0
 
LVL 5

Author Comment

by:Voodooman
ID: 13916047

Thanks


Voodooman
0
 
LVL 5

Author Comment

by:Voodooman
ID: 15760144
Hi

I found out the answer to this problem myself.

It concerns how you create the form.

If you use this the problem does not occur:

Var F_Login:TF_Login;

F_Login:=TF_Login.create(Nil);

F_Login.ShowModal;

However if you use this the problem does occurr:

Application.CreateForm(TF_Login,F_login);

F_Login.showmodal;

With this latter consturcyion, other forms from other brograms can 'get in between' the showing form and the modal form - strnage but true.

Apologies for not closing this myself and taking your time.


Voodooman
0
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
ID: 15801353
PAQed with points refunded (100)

Computer101
EE Admin
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Screencast - Getting to Know the Pipeline
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Suggested Courses
Course of the Month15 days, 4 hours left to enroll

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question