MsgBox is causing a Bug

This mesagebox worked perfectly until half hour ago.
Now when the code comes to the Line with the MsgBox, the programm stucks and I have to kill the process with taskmanager.
Any idea, what could be done?
(Windows 8.1)

Whats the error message and the line of code causing the problem?

Actually it has to do with another control: There is an array of textfields and in the eventhandler Lostfocusevent - if I write there any code, then it happens
: If Index=8 then x=y …
There is no errorcode, only a part of the window and mo msgbox and no reaction at all

and the line, which is causing the problem is msgbox = …
or X=msgbox(…
both of them
But is functioning normal, if I delete the code in the lostfocus-event …

[quote=99905:@Robert Blazek]and the line, which is causing the problem is msgbox = …
or X=msgbox(…
both of them
But is functioning normal, if I delete the code in the lostfocus-event …[/quote]

If you read http://documentation.xojo.com/index.php/Msgbox you will see that MsgBox is NOT a property, and cannot be used the way you do.

yes the first one is wrong should be msgbox(…

But this is completely unimportant.

I think Msgbox isn’t causing the problem.
The problem comes from the array of datafields.

I have two events in this array, which I mustn’t delete. (Textchange and LostFocus)
If I delete them, the debugger says: This item does not exist. And in the next Line:
Window1.textfield1.Name Layout (property name) - This item does not exist
Name

And if I undelete the event, the program runs properly.

So I think this is a bug.

It happens in my programm more often.
But I like the way an arry can be adressed (if it works).

[quote=99905:@Robert Blazek]But is functioning normal, if I delete the code in the lostfocus-event …

[/quote]
Could it be that the code in lostFocus fires when then msgbox gets the focus from inside the Textchange event?

I think there was also another effect involved.
I had a checkroutine running, fired by the window-close-event. In this situation the msgbox openend in the same moment, as the window closed.
Sometimes it ws fast enough, sometimes not and either it did hide the msgbox, which is somehow openmodal. So nothing else is working, until you answer the msgbox, but you cant see it…