focus to mbno

palabros
palabros used Ask the Experts™
on
i want the focus to mbno in messagedlg box
tct
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Mohammed NasmanSoftware Developer

Commented:
Hello

  I think that's not possible with MessageDlg, use MessageBox instead of it

    MessageBox(Handle,' Do you want to exist', 'warning', MB_YesNoCancel + MB_DefButton2 + MB_ICONInformation);

  refer to win 32 sdk help for more information

Best regards
Mohammed Nasman
Commented:
Hi,

Create your MessageBox with :

CreateMessageDialog(const Msg: string; DlgType: TMsgDlgType;
  Buttons: TMsgDlgButtons): TForm;

You get back the Form from the MessageBox. Then you can iterate over the Buttons (Components) on the Form.
The Buttons are Named like: ButtonNames: array[TMsgDlgBtn] of string = ('Yes', 'No', 'OK', 'Cancel', 'Abort', 'Retry', 'Ignore', 'All', 'NoToAll',
    'YesToAll', 'Help');

If you have retrieved the Button likely with:
btn := BoxForm.FindComponent('CANCEL');
you can call btn.SetFocus;

At least you must show the Dialog with Showmodal!

HTH Frank

palabros:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial