CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: Display Math Superscripts in label.caption

  1. #1
    Join Date
    Aug 2008
    Posts
    1

    Question Display Math Superscripts in label.caption

    I would like tot display x + y = ( x + y2 )2
    Where y2 is y superscript 2 and the trailing two is also a superscript.
    I have been unable to keep the formating from Word document when I display the question. With

    lbldsarg1.Caption = Worksheets("MathQ").Cells(intCount, 10)

    I do not like the appearance of text boxes and would prefer to display the math question on a label.

    - tia, KEI

    I search the FAQ's and Forum and did not find a solution. I apologize if I missed it.

  2. #2
    Join Date
    Aug 2005
    Location
    Imperial College London, England
    Posts
    490

    Re: Display Math Superscripts in label.caption

    Welcome to the Forums.

    The lack of solution on the forum is probably because there isn't a simple one - you can't vary a font inside a label by any method I've heard of.
    I can see a solution using some more complex methods - Basically, making a user control which can do this - and I'll probably be able to get some idea of a method soon.
    in the mean time, what's wrong with the traditional x^2 notation?
    Help from me is always guaranteed!*
    VB.NET code is made up on the spot with VS2008 Professional with .NET 3.5. Everything else is just made up on the spot.
    Please Remember to rate posts, use code tags, send me money and all the other things listed in the "Before you post" posts.

    *Guarantee may not be honoured.

  3. #3
    Join Date
    Aug 2005
    Location
    Imperial College London, England
    Posts
    490

    Re: Display Math Superscripts in label.caption

    here we go. This is a work in progress which I'm not going to finish. But the code gets you what you want, a label with superscript. And the image gives a nice demo
    Attached Images Attached Images  
    Attached Files Attached Files
    Help from me is always guaranteed!*
    VB.NET code is made up on the spot with VS2008 Professional with .NET 3.5. Everything else is just made up on the spot.
    Please Remember to rate posts, use code tags, send me money and all the other things listed in the "Before you post" posts.

    *Guarantee may not be honoured.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)