当前位置: 首页>>代码示例>>C#>>正文


C# PasswordBox.Focus方法代码示例

本文整理汇总了C#中System.Windows.Controls.PasswordBox.Focus方法的典型用法代码示例。如果您正苦于以下问题:C# PasswordBox.Focus方法的具体用法?C# PasswordBox.Focus怎么用?C# PasswordBox.Focus使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Windows.Controls.PasswordBox的用法示例。


在下文中一共展示了PasswordBox.Focus方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: checkSetting

        bool checkSetting(bool result, PasswordBox passwordBox, string message)
        {
            if (!result) {
                MessageBox.Show(message, resources["Connect"] as string, MessageBoxButton.OK, MessageBoxImage.Warning);
                passwordBox.SelectAll();
                passwordBox.Focus();
            }

            return result;
        }
开发者ID:kevenme,项目名称:x-wall,代码行数:10,代码来源:MainWindow.xaml.cs

示例2: OnApplyTemplate

 public override void OnApplyTemplate()
 {
     base.OnApplyTemplate();
     _pswb = (PasswordBox)GetTemplateChild("pswb");
     if (_pswb != null)
     {
         _pswb.Focus();
     }
     _pswb = (PasswordBox)GetTemplateChild("pswb");
 }
开发者ID:guozanhua,项目名称:phmi,代码行数:10,代码来源:SetPasswordDialog.cs

示例3: CheckTextBox

 public bool CheckTextBox(PasswordBox box)
 {
     if (box.Password.Length == 0)
     {
         MessageBox.Show("Вы ввели не все данные.");
         box.Focus();
         return false;
     }
     return true;
 }
开发者ID:bamx23,项目名称:CodenameNumbers,代码行数:10,代码来源:RegistrationWindow.xaml.cs

示例4: OnApplyTemplate

 public override void OnApplyTemplate()
 {
     base.OnApplyTemplate();
     _pswbOld = (PasswordBox)GetTemplateChild("pswbOld");
     if (_pswbOld != null)
     {
         _pswbOld.Focus();
     }
     _pswbNew = (PasswordBox)GetTemplateChild("pswbNew");
 }
开发者ID:guozanhua,项目名称:phmi,代码行数:10,代码来源:ChangePasswordDialog.cs

示例5: SparkleSetup


//.........这里部分代码省略.........
                        Canvas.SetTop (email_box, 230);
                        
                        Buttons.Add (cancel_button);
                        Buttons.Add (continue_button);
                        
                        Controller.UpdateSetupContinueButtonEvent += delegate (bool enabled) {
                            Dispatcher.BeginInvoke ((Action) delegate {
                                continue_button.IsEnabled = enabled;
                            });
                        };
                        
                        name_box.TextChanged += delegate {
                            Controller.CheckSetupPage (name_box.Text, email_box.Text);
                        };
                        
                        email_box.TextChanged += delegate {
                            Controller.CheckSetupPage (name_box.Text, email_box.Text);
                        };
                        
                        cancel_button.Click += delegate {
                            Dispatcher.BeginInvoke ((Action) delegate {
                                Program.UI.StatusIcon.Dispose ();    
                                Controller.SetupPageCancelled ();
                            });
                        };
                        
                        continue_button.Click += delegate {
                            Controller.SetupPageCompleted (name_box.Text, email_box.Text);
                        };
                        
                        Controller.CheckSetupPage (name_box.Text, email_box.Text);

                        if (name_box.Text.Equals ("")) 
                            name_box.Focus ();
                        else
                            email_box.Focus ();

                        break;
                    }

                    case PageType.Invite: {
                        Header      = "You’ve received an invite!";
                           Description = "Do you want to add this project to SparkleShare?";
        
                        
                        TextBlock address_label = new TextBlock () {
                            Text = "Address:",
                            Width = 150,
                            TextAlignment = TextAlignment.Right
                        };
                                                    
                        TextBlock address_value = new TextBlock () {
                            Text  = Controller.PendingInvite.Address,
                            Width = 175,
                            FontWeight = FontWeights.Bold
                        };
                        
                        
                        TextBlock path_label = new TextBlock () {
                            Text  = "Remote Path:",
                            Width = 150,
                            TextAlignment = TextAlignment.Right
                        };
                        
                        TextBlock path_value = new TextBlock () {
                            Width = 175,
开发者ID:rchicoli,项目名称:sparkleshare,代码行数:67,代码来源:SparkleSetup.cs

示例6: addInputType

        private void addInputType(InputType inputType)
        {
            if (inputType.Type == InputType.INPUT_TYPE_PASSWORD)
            {
                PasswordBox passwordBox = new PasswordBox();
                passwordBox.Password = inputType.Value;
                ContentPanel.Children.Add(passwordBox);
                passwordBox.Focus();
                passwordBox.LostFocus += new RoutedEventHandler(TextChanged_Clicked);
                passwordBox.KeyDown += OnKeyDownHandler;
            } else if (inputType.Type == InputType.INPUT_TYPE_DATE)
            {
                DatePicker datePicker = new DatePicker();
                datePicker.Header = inputType.Name;
                datePicker.Value = toDateTime(inputType.Value);
                ContentPanel.Children.Add(datePicker);
                datePicker.Focus();
                datePicker.ValueChanged += Date_Changed;

            } else
            {
                TextBox textBox = new TextBox();
                textBox.Text = inputType.Value;
                InputScope Keyboard = new InputScope();
                InputScopeName ScopeName = new InputScopeName();
                switch (inputType.Type)
                {
                    case InputType.INPUT_TYPE_DATE:
                        ScopeName.NameValue = InputScopeNameValue.Date;
                        break;
                    case InputType.INPUT_TYPE_AMOUNT:
                        ScopeName.NameValue = InputScopeNameValue.CurrencyAmount;
                        break;
                    case InputType.INPUT_TYPE_EMAIL:
                        ScopeName.NameValue = InputScopeNameValue.EmailUserName;
                        break;
                    case InputType.INPUT_TYPE_NUMBER:
                        ScopeName.NameValue = InputScopeNameValue.Number;
                        break;
                    case InputType.INPUT_TYPE_PASSWORD:
                        ScopeName.NameValue = InputScopeNameValue.Password;
                        break;
                    case InputType.INPUT_TYPE_PHONE:
                        ScopeName.NameValue = InputScopeNameValue.TelephoneNumber;
                        break;
                    case InputType.INPUT_TYPE_URL:
                        ScopeName.NameValue = InputScopeNameValue.Url;
                        break;
                    case InputType.INPUT_TYPE_STRING:
                        ScopeName.NameValue = InputScopeNameValue.Text;
                        break;
                }
                Keyboard.Names.Add(ScopeName);
                textBox.InputScope = Keyboard;
                ContentPanel.Children.Add(textBox);
                textBox.Focus();
                textBox.LostFocus += new RoutedEventHandler(TextChanged_Clicked);
                textBox.KeyDown += OnKeyDownHandler;
            }
        }
开发者ID:kisorbiswal,项目名称:accounter,代码行数:60,代码来源:MainPage.xaml.cs


注:本文中的System.Windows.Controls.PasswordBox.Focus方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。