omidaghakhani1368 Well-Known Member Licensed User Longtime User Mar 14, 2015 #1 Hi I try to get string height for set label's height but it is wrong value Is there other way to get string height?
Hi I try to get string height for set label's height but it is wrong value Is there other way to get string height?
ilan Expert Licensed User Longtime User Mar 14, 2015 #2 omidaghakhani1368 said: Hi I try to get string height for set label's height but it is wrong value Is there other way to get string height? Click to expand... do you want to get the hight of the view? (LABEL) or the textsize?? both you will need to do in (or after) Sub Page1_Resize (has been called) get the font size: Code: Copy Dim fontsize As Int = lbl.Font.Size get label size: Code: Copy Dim lblsize As Float = lbl.Height Upvote 0
omidaghakhani1368 said: Hi I try to get string height for set label's height but it is wrong value Is there other way to get string height? Click to expand... do you want to get the hight of the view? (LABEL) or the textsize?? both you will need to do in (or after) Sub Page1_Resize (has been called) get the font size: Code: Copy Dim fontsize As Int = lbl.Font.Size get label size: Code: Copy Dim lblsize As Float = lbl.Height
omidaghakhani1368 Well-Known Member Licensed User Longtime User Mar 14, 2015 #3 I want to get label height according to label text for add to scrollview Upvote 0
ilan Expert Licensed User Longtime User Mar 14, 2015 #4 is the text size changing in your code? Upvote 0
omidaghakhani1368 Well-Known Member Licensed User Longtime User Mar 14, 2015 #5 yes,i change textsize then font name and get height Upvote 0
ilan Expert Licensed User Longtime User Mar 14, 2015 #6 so if in the first start you have the font size and the label size that are correct and after changing you only need to change the label height so the font will fit inside then change the same % as you change to the font size like if font size is 18 and label height is 40 then if you change font size to 20 then this is (100/18 * 20 = 111.11 so 11.11% bigger) now add the same to your label height 40*1.11 = 44.44 (just a thought... , not sure it will do it but it worth a try..) Upvote 0
so if in the first start you have the font size and the label size that are correct and after changing you only need to change the label height so the font will fit inside then change the same % as you change to the font size like if font size is 18 and label height is 40 then if you change font size to 20 then this is (100/18 * 20 = 111.11 so 11.11% bigger) now add the same to your label height 40*1.11 = 44.44 (just a thought... , not sure it will do it but it worth a try..)
omidaghakhani1368 Well-Known Member Licensed User Longtime User Mar 14, 2015 #7 Thank you for your guide. I try it Upvote 0