Nkalampika Active Member Licensed User Aug 25, 2018 #1 Hello I posede a label and a panel, the label is child of panel. I would like the length of the label to be equal to the length of the panel! the length of the panel must vary according to the length of the label that is seen in the panel! how to do
Hello I posede a label and a panel, the label is child of panel. I would like the length of the label to be equal to the length of the panel! the length of the panel must vary according to the length of the label that is seen in the panel! how to do
Cableguy Expert Licensed User Longtime User Aug 25, 2018 #2 Being the Label the Child (which is logical as a Panel cannot be a child of a label), it should be more logical to resize the label on the Panel_Resize event... How are you determining if the label needs resizing? Upvote 0
Being the Label the Child (which is logical as a Panel cannot be a child of a label), it should be more logical to resize the label on the Panel_Resize event... How are you determining if the label needs resizing?
Nkalampika Active Member Licensed User Aug 26, 2018 #3 thank you for responding quickly this is the catch. I want the panel to resize according to the characters knowing that there is a label Attachments Capture d’écran (198).png 422.4 KB · Views: 448 Upvote 0
thank you for responding quickly this is the catch. I want the panel to resize according to the characters knowing that there is a label
S Stichler Active Member Licensed User Aug 26, 2018 #4 i could be wrong but couldn't you just set the length in Designer script? For instance if panel.settopandbottom = (0%y, 59%y) then set Label.settopandbottom = (0%y, 59%y) again im new so this may be way wrong in which case i am sorry Upvote 0
i could be wrong but couldn't you just set the length in Designer script? For instance if panel.settopandbottom = (0%y, 59%y) then set Label.settopandbottom = (0%y, 59%y) again im new so this may be way wrong in which case i am sorry
Nkalampika Active Member Licensed User Aug 26, 2018 #5 Exactly, there are already values in the designer! but the length of the text varies! I want the panel width to change according to the text Upvote 0
Exactly, there are already values in the designer! but the length of the text varies! I want the panel width to change according to the text
S Stichler Active Member Licensed User Aug 26, 2018 #6 Ahh i see what you mean now. Unfortunately im unsure how you might do that, sorry. Upvote 0
S Stichler Active Member Licensed User Aug 26, 2018 #7 I wouldnt know how to code it but could you maybe find out how many characters are in the label.text and then set up and if then? Like: If NumberofCharacters = SetAmount Then Label.length = Yoursetting? Last edited: Aug 26, 2018 Upvote 0
I wouldnt know how to code it but could you maybe find out how many characters are in the label.text and then set up and if then? Like: If NumberofCharacters = SetAmount Then Label.length = Yoursetting?
Erel B4X founder Staff member Licensed User Longtime User Aug 26, 2018 #8 You can use Canvas.MeasureStringWidth to find the required width. Upvote 0