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

Messagebox() behind modal form

Status
Not open for further replies.

Nro

Programmer
May 15, 2001
337
0
16
CA
It is a very strange behaviour.

I have a grid. Each cell is a container with some textbox and an invisible button (7 columns and 24 lines, it’s a calendar). When the user click on the button, I open a modal form with show(1).

So far so good, it’s working well, but sometimes, if I try to show a message (messagebox), the message box does not open, and everything is frozen. If I press “ALT key”, the messagebox pop out of nowhere and I can confirm.

I also noticed that when I have this messagebox behaviour, the cursor is like busy when it’s hoover the application, so I think there something working in the background. I’ve tried to log events (toggle event Tracking) from the debugger, but as soon as I turn it on, the waiting cursor stop…

I don’t know if I’m clear enough (english is not my primary language) , but it’s
very annoying.
Thanks, in advance.
Nro
 
Hello Mike
No timeout parameter.
 
Like I said, it seems random.
 

Hi,

You may want to have a look at the following thread thread184-1808364

hth

MarK
 
Ok, I think I found the problem, but I don’t know why…

In my container (in the grid) , like I said, I have Texts box, invisible Button, Editbox and a Shape controls. I also create a BackStyle_Access method to change the background colors or to hide or show some controls in the container. So, for each cell with a value, the grid will show different colors or objects (it’s a calendar with tasks).

If I hide the Shape object, and open my modal form, everything is ok when I try to show a messagebox.

If I show the Shape Object on my container from the BackStyle_Access method, and open the modal form, when I try to show a messagebox, nothing append, the screen is frozen, and I have to press Alt to pop the messagebox.

I think I’ll change the Shape object with an Editbox and look if it’s work…

Thanks again
[sup][/sup]
 
Now you mention it, I remember having a problem with a grid, a container and the BackStyle_Access method. I was using BackStyle_Access as a hook for firing an event. I expect you are doing something similar. I don't remember exactly what my problem was (it had nothing to do with message boxes). But I know that I solved it by removing the BackStyle_Access.

I don't know whether you are able to do the same. But it is something to keep in mind.

Mie

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
OK, I've just found the code that I mentioned above.

BackStyle_Access fires for each row in the grid. I was using it to make some visual changes to the controls within the container. The problem was that, if the user moved another form in such a way that it partly covered the grid, the BackStyle_Access would fire constantly, causing various unwanted side effects. When I removed the BackStyle_Access, the problem went away.

Nro, this might possibly be related to your problem, in that the message box might also be partly covering the grid. But I have no idea why that should be so or what to do about it.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Hello Mike

I did not mention it but I have the same behaviour : when I open my Modal form and I move it over one cell, the cell is flashing as if the BackStyle_Assign method fire (I did not notice that before you mention it)

I think it’s related with the Visible properties of some of my controls in the container.

Code:
*** Attente de matériel -> ATTMAT ***
IF (COU_HORATTMAT $ THIS.txtAaStat.Value) THEN
 THIS.shpRouge.Visible = .T.
 THIS.shpRouge.BackColor = RGB(255,0,0)
ENDIF

If I try this code, I will have the undesired behaviour, but if I change it to this

Code:
*** Attente de matériel -> ATTMAT ***
IF (COU_HORATTMAT $ THIS.txtAaStat.Value) THEN
 *THIS.shpRouge.Visible = .T.
 THIS.shpRouge.BackColor = RGB(255,0,0)
ENDIF

It’s working fine.

To fix it, instead of changing the visible property, at the beginning of the method, I just put the background color of the shape at white, and that’s it.

Thank for your help

Nro
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top