Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How to apply superscript for particular part of string or flowdocument

Posted on 2010-09-14
3
Medium Priority
?
1,034 Views
Last Modified: 2013-12-16
Please suggest on howto apply superscript for particular part of string or flowdocument.
0
Comment
Question by:Mohit_Kaushal
  • 2
3 Comments
 
LVL 12

Accepted Solution

by:
rajapandian_81 earned 500 total points
ID: 33680626
Refer
http://msdn.microsoft.com/en-us/library/system.windows.baselinealignment.aspx

<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <FlowDocumentReader>
        <FlowDocument ColumnWidth="800">
            <Paragraph Background="Green">               
                <Span FontSize="40">Baseline:</Span>
                <Span BaselineAlignment="Subscript">Subscript</Span>
                <Span BaselineAlignment="Baseline">Baseline</Span>
                <Span BaselineAlignment="Superscript">Superscript</Span>
            </Paragraph>            
        </FlowDocument>
    </FlowDocumentReader>
</Page>

Open in new window

0
 

Author Comment

by:Mohit_Kaushal
ID: 33686886
Thanks a lot rajapandian_81: I used the same approach to work with code as well.

Paragraph myParagraph = new Paragraph();
Span mySpan = new Span(new Run(myText));
mySpan .BaselineAlignment = BaselineAlignment.Superscript;
myParagraph .Inlines.Add(verseSpan);

FlowDocument myFlowDocument = new FlowDocument();
myFlowDocument.Blocks.Add(myParagraph);
0
 
LVL 12

Expert Comment

by:rajapandian_81
ID: 33689006
Welcome :-)
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Simulator games are perfect for generating sample realistic data streams, especially for learning data analysis. It is even useful for demoing offerings such as Azure stream analytics, PowerBI etc.
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

879 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question