Yvon Steinthal Active Member Licensed User Longtime User Jul 27, 2017 #1 Hello, I am using the RichString class for B4i to try to achieve AV (-1) <-superscript or exponent form In other words i want a label that has an exponent in it. Here's what i tried using the RichString class: B4X: Dim rs As RichString rs.Initialize("AV-1") rs.SuperScript(2,4) rs.SetToLabel(lblAV1) It doesn't work, i might be missing something... Help? Thanks Y.
Hello, I am using the RichString class for B4i to try to achieve AV (-1) <-superscript or exponent form In other words i want a label that has an exponent in it. Here's what i tried using the RichString class: B4X: Dim rs As RichString rs.Initialize("AV-1") rs.SuperScript(2,4) rs.SetToLabel(lblAV1) It doesn't work, i might be missing something... Help? Thanks Y.
Erel B4X founder Staff member Licensed User Longtime User Jul 27, 2017 #2 You can use this code: B4X: Dim cs As CSBuilder Label1.AttributedText = cs.Initialize.Append("AV").Font(Font.CreateNew(12)).VerticalAlign(-10).Append("-1").PopAll You need to set it in the page1_resize event or remove the AutoScaleAll call (see the tutorial: https://www.b4x.com/android/forum/threads/csbuilder-attributedstrings-builder.79153/#content). Upvote 0
You can use this code: B4X: Dim cs As CSBuilder Label1.AttributedText = cs.Initialize.Append("AV").Font(Font.CreateNew(12)).VerticalAlign(-10).Append("-1").PopAll You need to set it in the page1_resize event or remove the AutoScaleAll call (see the tutorial: https://www.b4x.com/android/forum/threads/csbuilder-attributedstrings-builder.79153/#content).