cirollo Active Member Licensed User Longtime User Nov 7, 2014 #1 Hi! I know is silly question but.... I'm trying to put some textfield on my app, when I tested the app (I've a button that changes the values in these textfields) I get some errors regarding textfield initialization, so I put this in the code Code: Private EditText1 as TextField ..... Private Sub Application_Start..... EditText1.Initialize("test") ..... the error doesn't come up, but the textfield has not the value "test" and I don't know how to assign values to the textfield by code.... let me know...regards, ciro
Hi! I know is silly question but.... I'm trying to put some textfield on my app, when I tested the app (I've a button that changes the values in these textfields) I get some errors regarding textfield initialization, so I put this in the code Code: Private EditText1 as TextField ..... Private Sub Application_Start..... EditText1.Initialize("test") ..... the error doesn't come up, but the textfield has not the value "test" and I don't know how to assign values to the textfield by code.... let me know...regards, ciro
Erel B4X founder Staff member Licensed User Longtime User Nov 7, 2014 #2 The Initialize method parameter is EventName. This sets the subs that handle the various events. Set the text with: EditText1.Text = "test" Note that it is better in most cases to use the designer to create the layout. Upvote 0
The Initialize method parameter is EventName. This sets the subs that handle the various events. Set the text with: EditText1.Text = "test" Note that it is better in most cases to use the designer to create the layout.
cirollo Active Member Licensed User Longtime User Nov 7, 2014 #3 Hi Erel! I'm using the designer but I need a button that, when pressed, will clear all the textfields, but I cannot do this! I tried also with your suggest, in this way: Code: Sub Button4_Click EditText1.Text="" EditText2.Text="" EditText3.Text="" EditText4.Text="" End Sub without success...(of course if I set the text property from the designer, it works, but I need to blank the fields at runtime) Upvote 0
Hi Erel! I'm using the designer but I need a button that, when pressed, will clear all the textfields, but I cannot do this! I tried also with your suggest, in this way: Code: Sub Button4_Click EditText1.Text="" EditText2.Text="" EditText3.Text="" EditText4.Text="" End Sub without success...(of course if I set the text property from the designer, it works, but I need to blank the fields at runtime)
klaus Expert Licensed User Longtime User Nov 7, 2014 #4 This EditText1.Text = "test" works. So the problem must be somewhere else ! Post a small project showing the problem and we will have a look at it. Upvote 0
This EditText1.Text = "test" works. So the problem must be somewhere else ! Post a small project showing the problem and we will have a look at it.
cirollo Active Member Licensed User Longtime User Nov 7, 2014 #5 Hi Klaus, simply add a button and one of the instructions above and let me know if you can change the text of a textfield at runtime... Upvote 0
Hi Klaus, simply add a button and one of the instructions above and let me know if you can change the text of a textfield at runtime...
cirollo Active Member Licensed User Longtime User Nov 7, 2014 #6 sorry, now is working! I deleted all the textfields and put new ones.....thank you Upvote 0