예제 #1
0
파일: .xaml.cs 프로젝트: Volpad/WpfApp1
        private void CreateInitialTextboxesAndAddToPanelWool(int rowCounter, Wool wool)
        {
            Canvas rootwool = new Canvas();

            rootwool.Margin = new Thickness(0, 20, 0, 0);
            TextBox colNumber = new TextBox();
            TextBox colName   = new TextBox();



            Canvas.SetLeft(colNumber, 0);
            Canvas.SetTop(colNumber, 0);


            colNumber.Name = "colNumberwool" + rowCounter;
            this.RegisterName(colNumber.Name, colNumber);
            colNumber.Text       = wool.ColourNo;
            colNumber.IsReadOnly = true;
            colNumber.Height     = 20;
            colNumber.Width      = 25;



            colName.Name = "colNamewool" + rowCounter;
            this.RegisterName(colName.Name, colName);
            colName.Text       = wool.ColourName;
            colName.Margin     = new Thickness(25, 0, 0, 0);
            colName.IsReadOnly = true;
            colName.Height     = 20;
            colName.Width      = 120;

            if (rowCounter % 2 == 0)
            {
                colName.Background   = new SolidColorBrush(Color.FromArgb(0, 0, 96, 97));
                colNumber.Background = new SolidColorBrush(Color.FromArgb(0, 0, 96, 97));
            }

            //    nameScope.RegisterName("col" + i, colNumber);
            //   nameScope.RegisterName("root" + i, root);
            rootwool.Children.Add(colNumber);
            rootwool.Children.Add(colName);
            //    root.Children.Add(b140first);
            stackPanelwool.Children.Add(rootwool);



            //b140first.Margin = new Thickness(140, 0, 0, 0);
            //b140first.Text = vamvakera.B140first.ToString();
            //b140first.Name = "b140first";
            //b140first.IsReadOnly = false;
            //b140first.Height = 20;
            //b140first.Width = 25;
            //b140first.LostFocus += new RoutedEventHandler(OnLostFocus);
        }
예제 #2
0
파일: .xaml.cs 프로젝트: Volpad/WpfApp1
        private static void SelectColumnWool(Wool wool, int columnCounter, ref int?firstColumnName, ref int?lastColumnName)
        {
            switch (columnCounter)
            {
            case 0:
                firstColumnName = wool.A116first;
                lastColumnName  = wool.A116last;
                break;

            case 1:
                firstColumnName = wool.A140first;
                lastColumnName  = wool.A140last;
                break;

            case 2:
                firstColumnName = wool.M128first;
                lastColumnName  = wool.M128last;
                break;

            case 3:
                firstColumnName = wool.M228first;
                lastColumnName  = wool.M228last;
                break;

            case 4:
                firstColumnName = wool.T128first;
                lastColumnName  = wool.T128last;
                break;

            case 5:
                firstColumnName = wool.M132first;
                lastColumnName  = wool.M132last;
                break;

            case 6:
                firstColumnName = wool.M134first;
                lastColumnName  = wool.M134last;
                break;

            case 7:
                firstColumnName = wool.M244first;
                lastColumnName  = wool.M244last;
                break;

            default:
                throw new Exception("Invalid Column Counter");
            }
        }