Android Question Custom Control how read property Single Line

Roberto P.

Well-Known Member
Licensed User
Longtime User
hi everyone
how read property Single Line for create new custom control?

I try to read the property from pannel o label, but It's not possibile.

thank
 

Attachments

  • Schermata 2018-11-11 alle 09.55.38.png
    11.1 KB · Views: 140

Roberto P.

Well-Known Member
Licensed User
Longtime User
ok, i'll create the same property.

#DesignerProperty: Key: Multilinee, DisplayName: Multi Line, FieldType: Boolean, DefaultValue: true
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
If you want to change the property in the code, you need to add two routines:
B4X:
Public Sub setMultiLine(MultiLine As Boolean)
    mMultiLine = Multiline
    'your code if needed
End Sub

Public Sub getMultiLine As Boolean
    Return mMultiline
End Sub
mMultiLine is a local variable in the class holding the property.
 
Upvote 0

Roberto P.

Well-Known Member
Licensed User
Longtime User
this is for read property

B4X:
mEdit.SingleLine             =     Not(Props.Get("Multilinee"))
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
You need to be clear on what you want!
Do you want a MultiLine property or a SingleLine propety?
Knowing that one is the opposite of the other.
I find it strange, it seems, that you want a SingleLine property but you ask for a MultiLine property !!??
Why not define directly a SingleLine propety?
 
Upvote 0

Roberto P.

Well-Known Member
Licensed User
Longtime User
Hi Klaus,

I created custom control, with edit control, that have a parameter that can setting the single line o multiline (are opposite).
but I see that it's impossibile to read the property inside the standard.

I hope it's clear.

regards
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
Add the custom property as suggested.
In my previous post, I was surprised that define a MultiLine property and then inside the code you transform into a SingleLine property.
To have a consitency with an EditText object, define s SinglLine property.
 
Upvote 0

Roberto P.

Well-Known Member
Licensed User
Longtime User
ok Klaus, I wrote this only for example. Excuse me for it.
regards
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…