> Dear All,
> I required a custom Messagebox insteed of available Messagebox() in VFP .
> bcoz, i want to change the font color & backcolor as well as Dynamic resizing as per Message length.
> i tried with modal window type form, but the problem is ... in conventional Messagebox() perfectly worked when call from lostfocus() of an object.. where as my modal form losses focus from that object.
> please suggest me..
>
> - Anal Roy Chowdhury
A modal window is exactly what I use for this sort of thing. Where do you want focus to go?
*** In .LostFocus() you can set focus to where ever you want
LOCAL lnRetVal
DO FORM "Path2\MyModalMessageBoxForm" TO lnRetVal
DO CASE
CASE lnRetVal < 0 && an error occurred (or what ever)
This.SetFocus()
CASE lnRetVal = 0
This.Parent.SomeOtherTextBox.SetFocus()
CASE lnRetVal > 0
This.Parent.SomeOtherControl.SetFocus()
ENDCASE
Of course, you could also use the .Valid(). Return a numeric value equal to the number of steps you wish to progress in the tab order from the modal form.
*** In the .Valid()
LOCAL lnRetVal
DO FORM "Path2\MyModalMessageBoxForm" TO lnRetVal
RETURN lnRetVal
Ken
You shall know the truth - and the truth shall set you free. (John 8:33)