文本框按顺序显示文本“已解决” [英] Textbox shows text by order "solved"

查看:46
本文介绍了文本框按顺序显示文本“已解决”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

例如,当我点击按钮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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆