Esempio n. 1
0
 void t_GotFocus(object sender, RoutedEventArgs e)
 {
     if (t != null)
     {
         MyTextBox.Focus();
     }
 }
Esempio n. 2
0
 public MyDialogWindow(Window owner)
 {
     InitializeComponent();
     this.Owner = owner;
     MyTextBox.Focus();
     MyTextBox.KeyDown += MyTextBox_KeyDown;
 }
Esempio n. 3
0
        //back space button
        private void Button_Click_2(object sender, RoutedEventArgs e)
        {
            string text = MyTextBox.Text;

            MyTextBox.Text = text.Substring(0, text.Length - 1);
            MyTextBox.Focus();
        }
Esempio n. 4
0
        void textBox_LostFocus(object sender, RoutedEventArgs e)
        {
            if (Field == Big3.Hitbase.DataBaseEngine.Field.Price)
            {
                SaveControlData();
                UpdateControlData();
            }

            if (Field == Field.ArtistCDName)
            {
                hitbaseMainWindowControl.UpdateAllControls();
            }

            if (Field == Field.ArchiveNumber)
            {
                if (Configuration.Settings.Current.NoDuplicateArchiveNumbers)
                {
                    int recordFound = hitbaseMainWindowControl.DataBase.CheckArchiveNumber(textBox.Text);

                    if (recordFound > 0 && recordFound != hitbaseMainWindowControl.theCd.ID)           // Doppelte Archiv-Nummer gefunden!!
                    {
                        MessageBox.Show(StringTable.ArchiveNumberAlreadyExists, System.Windows.Forms.Application.ProductName, MessageBoxButton.OK, MessageBoxImage.Information);
                        textBox.Focus();
                    }
                }
            }
        }
Esempio n. 5
0
        private void MyPopup_GotFocus(object sender, RoutedEventArgs e)
        {
            var source = (HwndSource)PresentationSource.FromVisual(MyPopup.Child);

            if (source != null)
            {
                SetFocus(source.Handle);
                MyTextBox.Focus();
            }
        }
Esempio n. 6
0
        private void btnAddRow_Click(object sender, EventArgs e)
        {
            MyTextBox.SelectionChanged -= richTextBox_SelectionChanged;
            var tabTemp    = tabControlMain.SelectedTab;
            var index      = MyTextBox.GetFirstCharIndexOfCurrentLine();
            var insertText = GetSelectedTabsString();

            if (!MyTextDataAdapter.HasCrLf)
            {
                insertText = insertText + "\r\n";
            }
            var nextIndex = index + insertText.Length;

            MyTextBox.Text           = MyTextBox.Text.Insert(index, insertText);
            MyTextBox.SelectionStart = nextIndex;

            tabControlMain.SelectedTab  = tabTemp;
            MyTextBox.SelectionChanged += richTextBox_SelectionChanged;
            MyTextBox.Focus();
        }
Esempio n. 7
0
        private void InitCustomLayout()
        {
            var list = TupleList();

            foreach (Tuple <string, Grid> tuple in list)
            {
                // create a char array from string
                char[] charArray = tuple.Item1.ToCharArray();

                // add cells to the grid
                foreach (char a in charArray)
                {
                    tuple.Item2.ColumnDefinitions.Add(new ColumnDefinition());
                }

                // for loop - create button with all the properties and asign an [EventHandler]
                for (int i = 0; i < charArray.Length; i++)
                {
                    Button button = new Button();
                    button.Width   = 30.0;
                    button.Height  = 30.0;
                    button.Content = charArray[i].ToString();
                    button.Click  += new RoutedEventHandler(OnClick);

                    Grid.SetColumn(button, i);
                    tuple.Item2.Children.Add(button);
                }
            }

            void OnClick(object sender, RoutedEventArgs e)
            {
                Button button = (Button)sender;

                MyTextBox.AppendText((string)button.Content);
                MyTextBox.Focus();
            }
        }
Esempio n. 8
0
 public void FocusText()
 {
     MyTextBox.Focus();
 }
Esempio n. 9
0
 // space button
 private void Button_Click_1(object sender, RoutedEventArgs e)
 {
     MyTextBox.AppendText(" ");
     MyTextBox.Focus();
 }
Esempio n. 10
0
 public MyDialogWindow()
 {
     InitializeComponent();
     MyTextBox.Focus();
     MyTextBox.KeyDown += MyTextBox_KeyDown;
 }
 private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     MyTextBox.Document = (FlowDocument)XamlReader.Parse(UserString);
     MyTextBox.Focus();
     MyTextBox.SelectAll();
 }
 private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     MyTextBox.Text = UserString;
     MyTextBox.Focus();
     MyTextBox.SelectAll();
 }
Esempio n. 13
0
 private void Grid_DoubleTapped(object sender, DoubleTappedRoutedEventArgs e)
 {
     m_Model.Editing = true;
     MyTextBox.Focus(FocusState.Programmatic);
 }