Reputation: 171
I am writing a WP8 app, and I want to add one particular functionality - there is textBlock on a page that may contain text of different length. I want to add some control, that would allow writing down letters of the text separately. My first idea was to create GridView with textBoxes, however there is no such control as GridView in WP8 and apart from that, I don't think that is the best sollution. I can't really think of any way how to do this, so I am asking You for help - help me please, 'cause I'm really out of ideas. It should look sth like this:
I am sorry if my question is unclear - I am just not sure how to express my idea.
Thank You in advance for Your help! :)
Upvotes: 0
Views: 113
Reputation: 792
string s = "stackoverflow"; // or = mytextblock.Text; in your example.
foreach (char c in s)
{
//create a new textbox
TextBox tb = new TextBox();
//you should make some changes to the textbox here (size, maxlength, name, etc.)
//add the textbox to your stackpanel
mystackpanel.Children.Add(tb);
}
and something like the following in your XAML:
<StackPanel Orientation="Horizontal" Name="mystackpanel"/>
Upvotes: 1