[CLOSED] Focus X.Msg.Show

  1. #1

    [CLOSED] Focus X.Msg.Show

    I have an event scheduled for fall catch (Exception ex).
    Inside the catch I display a message.
    X.Msg.Show(new MessageBoxConfig
                    {
                        Title = "Login",
                        Message = ex.Message.ToString(),
                        Buttons = MessageBox.Button.OK,
                        Icon = MessageBox.Icon.WARNING
                        
                    });
    
    txtUsuario.Focus();
    I set the focus to a specific textfield after displaying the message.
    But it is by setting the focus to the textfield.
    How?
    Last edited by Daniil; May 02, 2011 at 10:32 AM. Reason: [CLOSED]
  2. #2
    this should work!

    X.Msg.Show(new MessageBoxConfig
                    {
                        Title = "Login",
                        Message = ex.Message.ToString(),
                        Buttons = MessageBox.Button.OK,
                        Icon = MessageBox.Icon.WARNING
                         Closable = false,
                        Handler = @"switch (buttonId) {
                                case 'ok':
                               txtUsuario.focus();
                                break;
                          }"
                    });
  3. #3
    Hi all,

    Yes, the @webclouder's sample works fine.

    Don't forget to add a comma at the end of
    Icon = MessageBox.Icon.WARNING
    to avoid an compile time error.

Similar Threads

  1. Replies: 1
    Last Post: Jan 17, 2014, 3:43 PM
  2. Replies: 5
    Last Post: Apr 28, 2012, 7:42 AM
  3. Replies: 3
    Last Post: Mar 19, 2012, 12:35 PM
  4. Replies: 1
    Last Post: Jan 27, 2012, 11:32 AM
  5. [CLOSED] Set Focus to OK button in Ext.Msg.Show
    By speedstepmem3 in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Jun 13, 2011, 1:12 PM

Posting Permissions