locked
Wpf dynamic control of textboxes in window RRS feed

  • Question

  • in my try to create dynamic textboxes but cannot create can u plz help me...

    when is compile windows cannot show the textblock and button why..plz help

    a file is attached plz check and edit thanks

    GridDynamicGrid = newGrid();

    DynamicGrid.Width = 400;

    DynamicGrid.HorizontalAlignment = HorizontalAlignment.Left;

    DynamicGrid.VerticalAlignment = VerticalAlignment.Top;

    DynamicGrid.ShowGridLines = true;

    DynamicGrid.Background = newSolidColorBrush(Colors.LightSteelBlue);

    //Adding columns to datagrid

    ColumnDefinitiongridCol1 = newColumnDefinition();

    ColumnDefinitiongridCol2 = newColumnDefinition();

    DynamicGrid.ColumnDefinitions.Add(gridCol1);

    DynamicGrid.ColumnDefinitions.Add(gridCol2);

    // Add first column header

    TextBlocktxtBlock1 = newTextBlock();

    txtBlock1.Text = "Particulars";

    txtBlock1.FontSize = 14;

    txtBlock1.FontWeight = FontWeights.Bold;

    txtBlock1.Foreground = newSolidColorBrush(Colors.Green);

    txtBlock1.VerticalAlignment = VerticalAlignment.Top;

    Grid.SetRow(txtBlock1, 0);

    Grid.SetColumn(txtBlock1, 0);

    // Add second column header

    TextBlocktxtBlock2 = newTextBlock();

    txtBlock2.Text = "Amount";

    txtBlock2.FontSize = 14;

    txtBlock2.FontWeight = FontWeights.Bold;

    txtBlock2.Foreground = newSolidColorBrush(Colors.Green);

    txtBlock2.VerticalAlignment = VerticalAlignment.Top;

    Grid.SetRow(txtBlock2, 0);

    Grid.SetColumn(txtBlock2, 1);

    //// Add column headers to the Grid

    DynamicGrid.Children.Add(txtBlock1);

    DynamicGrid.Children.Add(txtBlock2);

     
    Sunday, August 2, 2015 4:40 AM

Answers

All replies