Answered by:
Wpf dynamic control of textboxes in window

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
-
I'd try them over here.
Regards, Dave Patrick ....
Microsoft Certified Professional
Microsoft MVP [Windows]
Disclaimer: This posting is provided "AS IS" with no warranties or guarantees , and confers no rights.- Marked as answer by Muhammad Adnan() Sunday, August 2, 2015 6:25 PM
- Unmarked as answer by Muhammad Adnan() Sunday, August 2, 2015 6:25 PM
- Proposed as answer by Mike Laughlin Monday, August 3, 2015 12:59 PM
- Marked as answer by Just Karl Friday, August 14, 2015 3:41 PM
Sunday, August 2, 2015 12:40 PM
All replies
-
I'd try them over here.
Regards, Dave Patrick ....
Microsoft Certified Professional
Microsoft MVP [Windows]
Disclaimer: This posting is provided "AS IS" with no warranties or guarantees , and confers no rights.- Marked as answer by Muhammad Adnan() Sunday, August 2, 2015 6:25 PM
- Unmarked as answer by Muhammad Adnan() Sunday, August 2, 2015 6:25 PM
- Proposed as answer by Mike Laughlin Monday, August 3, 2015 12:59 PM
- Marked as answer by Just Karl Friday, August 14, 2015 3:41 PM
Sunday, August 2, 2015 12:40 PM -
I create a dynamic wpf application when I run window is empty .... dynamic texboxes or button cannot appear..
can u plz tell thanksSunday, August 2, 2015 6:25 PM -
This is "Where Is" forum. The purpose of this forum is to tell you where to go ask questions. You'll need to ask over here.
Regards, Dave Patrick ....
Microsoft Certified Professional
Microsoft MVP [Windows]
Disclaimer: This posting is provided "AS IS" with no warranties or guarantees , and confers no rights.- Proposed as answer by Mike Laughlin Monday, August 3, 2015 12:59 PM
Sunday, August 2, 2015 7:56 PM