Re: RaiseEvent and vbModal
If you have a modal dialog box open, application of a program's execution is delayed until it is closed. This is illustrated more clearly by the following example.
frmMyForm.show vbModal
msgbox "Form closed"
It is probably obvious that the message box above is not displayed unless the form is closed. In your case, it is less obvious but the same principle applies.
Charlie Zimmerman
http://www.freevbcode.com
[email protected]
Re: RaiseEvent and vbModal
Your client exe will work when it is compiled (when both OCX and client project are compiled).
This is known difference between running program in VB IDE and compiled.
When modal form is shown, VB IDE will not (there are some exceptions*) fire events on other forms. In EXE events will be fired.
(Sample for this behaviour is Karl E. Peterson's code for closing MsgBox; uses the fact that Timers are only blocked in the IDE, and will continue to work in an EXE)
If you need your events in IDE, there are 2 workarounds:
- use non compiled version of OCX, i.e. add OCX project to project group. (*)
- use special class for creating events (complicated)
Re: RaiseEvent and vbModal
Thanx
i test it using the exe (and not under vb) and all is ok.
Re: RaiseEvent and vbModal
this is because once the modal window is initiated all the code after the window call is paused until the modal window is closed. no code of the timer will be executed until the modal window is released.
take for example the sample code :
Form1.Show vbModal
msgbox "Hello World !!"
the msgbox will not be display until the Form1 is closed.
Re: RaiseEvent and vbModal
No i know that and i raise on a timer scheduler.
But ok now the problem is that in vb environment event are not raised until modal window are opened.
But all is ok now if i run the compiled exe.