Android Question problem of resizing with a panel

Nkalampika

Active Member
Licensed User
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
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

Nkalampika

Active Member
Licensed User
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: 215
Upvote 0

Stichler

Active Member
Licensed User
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

Nkalampika

Active Member
Licensed User
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

Stichler

Active Member
Licensed User
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:
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…