Alexander Stolte Expert Licensed User Longtime User Nov 7, 2018 #1 Hello, i make a new custom view and i have a "CustomView Property" witch i want to change in the code, the type of this Property is String in a list. The User has 3 Options to choose in the designer, now i want to cause a error in the IDE if the user type a wrong input in this variable, is this possible? Greetings
Hello, i make a new custom view and i have a "CustomView Property" witch i want to change in the code, the type of this Property is String in a list. The User has 3 Options to choose in the designer, now i want to cause a error in the IDE if the user type a wrong input in this variable, is this possible? Greetings
Erel B4X founder Staff member Licensed User Longtime User Nov 7, 2018 #2 How is the custom property defined in your code? Upvote 0
Alexander Stolte Expert Licensed User Longtime User Nov 7, 2018 #3 Erel said: How is the custom property defined in your code? Click to expand... Code: Copy #DesignerProperty: Key: Icon_direction, DisplayName: Icon Direction, FieldType: String, DefaultValue: LEFT, List: LEFT|MIDDLE|RIGHT and i load this in a string on view create. Upvote 0
Erel said: How is the custom property defined in your code? Click to expand... Code: Copy #DesignerProperty: Key: Icon_direction, DisplayName: Icon Direction, FieldType: String, DefaultValue: LEFT, List: LEFT|MIDDLE|RIGHT and i load this in a string on view create.
klaus Expert Licensed User Longtime User Nov 7, 2018 #4 ... if the user type a wrong input in this variable, is this possible? Click to expand... Yes, it is possible. You need to define a Property in the code, like: Code: Copy Public Sub setMyProperty(MyProperty As String) If MyProperty = Option1 Or MyProperty = Option2 Or MyProperty = Option3 Then mMyProperty = MyProperty 'class internal variable 'other code Else MsgBox(.... End If End Sub Public Sub getMyProperty As String Return MyProperty End Sub In the main code: MyCustomView.MyProperty = xxx All this is explained in the B4X CustomViews Booklet. Upvote 0
... if the user type a wrong input in this variable, is this possible? Click to expand... Yes, it is possible. You need to define a Property in the code, like: Code: Copy Public Sub setMyProperty(MyProperty As String) If MyProperty = Option1 Or MyProperty = Option2 Or MyProperty = Option3 Then mMyProperty = MyProperty 'class internal variable 'other code Else MsgBox(.... End If End Sub Public Sub getMyProperty As String Return MyProperty End Sub In the main code: MyCustomView.MyProperty = xxx All this is explained in the B4X CustomViews Booklet.