如何使用块将值插入(而不是设置)到文本框/标签中
我正在创建一个具有多个按钮的应用程序,当单击这些按钮时,我希望将值添加到文本框/标签(然后可以作为文本发送) - 基本上,您不需要键入文本,而是单击预先写好的单词作为按钮将它们放入文本中。
但是,在块编辑器中,我只能将按钮的值设置为文本框。因此它只包含一个值,如果单击另一个值,它只会替换它。
如何使用块编辑器将值插入文本框/标签?
谢谢。
[编辑]我已经找到了一种方法,如果其他人有类似的问题,您可以使用以下块:
当按钮单击> > 设置 MYtextbox.text 为 > (从文本菜单加入块)> MYtextbox.text (加入) MYbutton.text
- 请更改此问题以解决。
Im creating an app that has a number of buttons, and when these buttons are clicked I want the value to be added to a text box/label (That can then be sent as a text) - Basically instead of typing a text you click the pre-written words as a button to put them into a text.
However In the blocks editor I can only set the value of the button, to the text box. So It only contains one value, and if another is clicked it simply replaces it.
How do I go about inserting a value into a text box/label using the blocks editor?
Thanks.
[EDIT] I've figured out a way to do it if anyone else had similar problems, you use the blocks:
when button click > set MYtextbox.text to > (Join block from text menu) > MYtextbox.text (Join) MYbutton.text
-Please changed this to solved.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我不熟悉块编辑器,但在java中我会写以下内容,也许会对你有所帮助:
I'm not familiar with blocks editor, but in java I would write the following, maybe it will help you:
这很容易。基本文本块抽屉中有“连接”块。
当您将文本添加到已有文本的文本框(例如 Textbox1)时,您应该将块组装为 Textbox1 加入 Label1。它与我们在 Visual Basic 中所说的非常相似,例如 Textbox1 = Textbox1 & Label1 或其他。
您还可以使用 maketext 块。当您使用此块时,将 Textbox1 设置为 maketext 块。首先在第一个套接字中插入 Textbox1 块,然后将带有基本文本块的新文本添加到随后的套接字中。
It is easy. There is the "join" block in the basic text blocks drawer.
When you are adding text to a text box that already has text, for example Textbox1 then you should assemble the blocks as Textbox1 join Label1. It is very similar to what we say in visual basic, for example Textbox1 = Textbox1 & Label1 or whatever.
You can also use maketext block. When you use this block set Textbox1 to maketext block. First insert Textbox1 block in the first socket and add new text with basic text block to the ensuing sockets.