Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. articles. downloads. faq. members. files. rss.
 From: Ken Murphy
  Where is Ken Murphy?
 Springhill
 Canada
 Ken Murphy
 To: A Roy Chowdhury
  Where is A Roy Chowdhury?
 kolkata
 India
 A Roy Chowdhury
Subject: RE: Customize MessageBox Class
Thread ID: 165614 Message ID: 165617 # Views: 4 # Ratings: 0
Version: Visual FoxPro 9 Category: Forms
Date: Wednesday, March 26, 2008 11:25:12 AM         
   



> 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)

ENTIRE THREAD

Customize MessageBox Class Posted by anal Roy Chowdhury @ 3/26/2008 9:02:55 AM
RE: Customize MessageBox Class Posted by Ken Murphy @ 3/26/2008 11:25:12 AM
RE: Customize MessageBox Class Posted by Andy Kramek @ 3/26/2008 11:48:39 AM