简体   繁体   中英

Windows phone textBox issue

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! :)

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"/>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM