locked
can I apply bullets to the text in the textblock? RRS feed

  • Question

  • Hello everyone,

    I need to apply bullets to the textblock content. How can I apply?

    like this

    1. hi
    2. hello

    Please suggest me.

    Thanks in advance.

    • Edited by Anusha V Wednesday, November 20, 2013 5:00 AM
    • Moved by Ricky_Brundritt Wednesday, November 20, 2013 2:44 PM
    Wednesday, November 20, 2013 4:58 AM

Answers

  • You can add bullets in text easily. Simply use the bullet character you prefer (Character map has a bunch to choose from). For example:

    <RichTextBlock FontFamily="Segoe UI" Foreground="Black">
        <Paragraph>
            &#x26AB; Item 1<LineBreak/>
            &#x26AB; Item 2<LineBreak/>
            &#x26AB; Item 3<LineBreak/>
        </Paragraph>
    </RichTextBlock>
    Also, I'm going to move this post to the Windows Store app forum you posted this question in the Bing Maps Windows Store forum which is focused on the mapping SDK.


    http://rbrundritt.wordpress.com

    Wednesday, November 20, 2013 2:40 PM
  • I paste some C# code for your issue, it works as same as Ricky's XAML code:

                Paragraph a = new Paragraph();
                Run a1 = new Run();
                a1.Text = "⚫ Item 1";
                Run a2 = new Run();
                a2.Text = "⚫ Item 2";
                Run a3 = new Run();
                a3.Text = "⚫ Item 3";
                a.Inlines.Add(a1);
                a.Inlines.Add(new LineBreak());
                a.Inlines.Add(a2);
                a.Inlines.Add(new LineBreak());
                a.Inlines.Add(a3);
                a.Inlines.Add(new LineBreak());
                rtb1.Blocks.Add(a);

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Tuesday, November 26, 2013 8:03 AM
    Moderator

All replies

  • Use the RichTextblock class instead as that will allow you to apply formatting to your text: http://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.xaml.controls.richtextblock.aspx


    http://rbrundritt.wordpress.com

    • Proposed as answer by Ricky_Brundritt Wednesday, November 20, 2013 9:43 AM
    Wednesday, November 20, 2013 9:43 AM
  • yes. I have tried that also, but there is no property to apply bullets to the text in Richtextblock.

    Wednesday, November 20, 2013 12:11 PM
  • You can add bullets in text easily. Simply use the bullet character you prefer (Character map has a bunch to choose from). For example:

    <RichTextBlock FontFamily="Segoe UI" Foreground="Black">
        <Paragraph>
            &#x26AB; Item 1<LineBreak/>
            &#x26AB; Item 2<LineBreak/>
            &#x26AB; Item 3<LineBreak/>
        </Paragraph>
    </RichTextBlock>
    Also, I'm going to move this post to the Windows Store app forum you posted this question in the Bing Maps Windows Store forum which is focused on the mapping SDK.


    http://rbrundritt.wordpress.com

    Wednesday, November 20, 2013 2:40 PM
  • k fine. Actually I need to apply bullets dynamically not at the design time.
    Thursday, November 21, 2013 4:28 AM
  • I paste some C# code for your issue, it works as same as Ricky's XAML code:

                Paragraph a = new Paragraph();
                Run a1 = new Run();
                a1.Text = "⚫ Item 1";
                Run a2 = new Run();
                a2.Text = "⚫ Item 2";
                Run a3 = new Run();
                a3.Text = "⚫ Item 3";
                a.Inlines.Add(a1);
                a.Inlines.Add(new LineBreak());
                a.Inlines.Add(a2);
                a.Inlines.Add(new LineBreak());
                a.Inlines.Add(a3);
                a.Inlines.Add(new LineBreak());
                rtb1.Blocks.Add(a);

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Tuesday, November 26, 2013 8:03 AM
    Moderator