Click here to Skip to main content
15,887,746 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
How to create array of labels manually(i.e without drag and drop of labels from ToolBox) in wpf application?
Posted
Updated 11-Dec-12 21:02pm
v2

1 solution

Hi,

Just create the controls (labels) dynamically. Here is a small code snippet that demonstrates the concept:

C#
var window = new Window();
var stackPanel = new StackPanel { Orientation = Orientation.Vertical };
stackPanel.Children.Add(new Label { Content = "Label" });
stackPanel.Children.Add(new Button { Content = "Button" });
window.Content = stackPanel;


Otherwise, refer to the following: wpf - create controls dynamically[^]

Kind regards,
 
Share this answer
 
Comments
Prabhu_Sri_ 20-Dec-12 2:37am    
The answer is not satisfactory. Kindly improve
Programm3r 22-Dec-12 10:55am    
'..Kindly improve..' LMAO! I do not think so o_O !

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900