文本框按顺序显示文本“已解决” [英] Textbox shows text by order "solved"
问题描述
例如,当我点击按钮NEXT时,我在vb中创建的文件显示我总是在文本框中显示不同的文字..我想按顺序向我显示文字,当我点击按钮时
截图示例
http://s14.postimg.org/hvfsmsv9t/Untitled.jpg [ ^ ]
第三次点击
第四次点击
等..
所以那是当我点击按钮向我显示订单1,2,3,4,5,6等而不是随机的时候我想要设置的内容..
1 TextBox1.Text =hi
2 TextBox1.Text =你好
3 TextBox1.Text =bla
4 TextBox1。 Text =bl11a
5 TextBox1.Text =b11la
6 TextBox1.Text =bl111a
等....
所以...将文本设置为数组:
private string [] lines = { hi, hello, bla};
private int next;
然后在表单中加载:
TextBox1.Text = lines [ 0 ];
next = 1 ;然后,您的按钮代码只是:
TextBox1.Text = lines [next ++];
如果(下一个> = lines.Length)next = 0 跨度>;
How to for example when I click on button "NEXT" I've created in vb shows me always different text in textbox.. I want to show me text by order, when I click on button
Screenshot example
http://s14.postimg.org/hvfsmsv9t/Untitled.jpg[^]
third click
fourth click
etc..
so thats what I want to set up when I click button to show me text by order 1,2,3,4,5,6 etc and not randomly..
1 TextBox1.Text = "hi"
2 TextBox1.Text = "hello"
3 TextBox1.Text = "bla"
4 TextBox1.Text = "bl11a"
5 TextBox1.Text = "b11la"
6 TextBox1.Text = "bl111a"
etc....
So...set up your text as a array:
private string[] lines = {"hi", "hello", "bla"}; private int next;
Then in your form load:
TextBox1.Text = lines[0]; next = 1;Then, your button code is just:
TextBox1.Text = lines[next++]; if (next >= lines.Length) next = 0;
这篇关于文本框按顺序显示文本“已解决”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!