Daniel G Member Licensed User Longtime User Feb 19, 2014 #1 Hi , I have a layout with a spinner and I try to change the text of a button in this layout with the spinner value Can you tell me where is the problem ? All the sub run ok but the layout not change... Thank's Daniel Sub Spinner1_ItemClick (Position As Int, Value As Object) Activity.Invalidate Dim Lavaleur As String Dim Button2 as button Button2.Initialize(Button2) Lavaleur=Spinner1.GetItem(Position) Button2.Initialize(Button2) Button2.text=Lavaleur end
Hi , I have a layout with a spinner and I try to change the text of a button in this layout with the spinner value Can you tell me where is the problem ? All the sub run ok but the layout not change... Thank's Daniel Sub Spinner1_ItemClick (Position As Int, Value As Object) Activity.Invalidate Dim Lavaleur As String Dim Button2 as button Button2.Initialize(Button2) Lavaleur=Spinner1.GetItem(Position) Button2.Initialize(Button2) Button2.text=Lavaleur end
LucaMs Expert Licensed User Longtime User Feb 19, 2014 #2 You should not initialize the button2 in that the Designer has already done. The declaration of the button goes into the Globals routine. Lavaleur = Value Code: Copy Sub Spinner1_ItemClick (Position As Int, Value As Object) Button2.text = Value End Sub (to post your code in the post, you can use the "Code" menu button) Upvote 0
You should not initialize the button2 in that the Designer has already done. The declaration of the button goes into the Globals routine. Lavaleur = Value Code: Copy Sub Spinner1_ItemClick (Position As Int, Value As Object) Button2.text = Value End Sub (to post your code in the post, you can use the "Code" menu button)