Click here to Skip to main content
15,886,799 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Recently I got a requirement that I have to show a decimal value in a wpf text box with different font sizes like number before decimal should be small and the number after decimal should be large and it is editable field.
I searched in Google but I didn't find solution.Please help me how to achieve this.

Thanks
Ramesh
Posted

1 solution

Tricky. My best bet would be to draw this manually.
You'll need to define a class that holds the value of the textbox and also the properties of the characters (editable, color, size, whatever you want). I'm not sure how far this needs to go. If the layout is not editable by the user you could probably get away with an edit mode (showing your normal (masked)textbox) and a show mode (showing the correct layout). doubleclicking or pressing a button could switch between the two modes (for example)

I'm pretty sure you'll not get a complete answer for this, so try to divide your problem in smaller problems and solve those one by one.

This is pretty complex. Take your time to design this.

Hope this helps (a little)
 
Share this answer
 
Comments
Ramesh Reddy Kollu 23-May-14 3:39am    
Thank you V.
V. 23-May-14 4:09am    
You're welcome :-)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900