473,386 Members | 1,801 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Using loop in text box

Hello I used textbox in my project i write a number and some thing writing i textbox using loop
for example
i used this code
Expand|Select|Wrap|Line Numbers
  1. Private Sub Command1_Click()
  2. Dim i As Integer
  3. For i = 0 To 10
  4. Text1.Text = "work is great" & i
  5. Next i
  6. End Sub
but when i run program and click button only see result work is great10

i run
work is great0
work is great1
work is great2
work is great3
work is great4
.
.
.
how can this work in textbox
Dec 19 '13 #1
2 1353
Rabbit
12,516 Expert Mod 8TB
Please use code tags when posting code or formatted data.

All UI update events are suspended until code has finished running. You need to use a Timer object if you want the UI to update in between each run.
Dec 19 '13 #2
Flinty
11
'
'add timer control to form
'set interval to 1500 and enabled = false
Expand|Select|Wrap|Line Numbers
  1. Option Explicit
  2. Dim C
  3. Private Sub Command1_Click()
  4.     Timer1.Enabled = True
  5. '
  6. End Sub
  7.  
  8. Private Sub Timer1_Timer()
  9. '
  10.     C = C + 1
  11.        Text1 = "Work is great" & " " & C
  12.         If C >= 11 Then
  13.             Timer1.Enabled = False
  14.             Text1 = ""
  15.         End If
  16. '
  17. End Sub
  18.  
Dec 19 '13 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: R Bolling | last post by:
I have a text file from a text document that has very long rows (two or three paragraphs from a text document for each row). Importing to text cuts it off at 255 characters, and importing to a...
2
by: chrisse | last post by:
Hey, I'm having quite a bit of trouble trying to filter through a list using a text box and multiple combo boxes. When you write anything in the text box the list goes blank. Although when you...
5
by: Steve S | last post by:
Heres what I want to do...User types into a texbox, clicks a button, the button saves that text to a file. The problem is that when I click the submit button, any changes made to the textbox are...
0
by: angus | last post by:
Dear all, I am using multiline text box(textarea) in datagrid. I've found that i cannot use a new line character. is it my problem? Regards, Angus
1
by: mr k | last post by:
Hi, I wanted to use mail merge with forms but Text form fields are not retained during mail merge in Word, I got the code from Microsoft but it doesn't remember the text form field options such as...
3
by: gardner | last post by:
Please help. I am trying to count something in a Group Footer using a Text Box. If what I am doing is not doable, or there is a better way to structure this please tell me. Here is the situation:...
3
by: nico3334 | last post by:
I'm filling in a Report with SQL data using VB code. I'm using LOOP and MoveNext. Before using MoveNext, I would like to be able to check whether the new data is equal to the previous data that was...
5
by: boss1 | last post by:
hi all, i have a problem with loop in select statement.i m using code : <select name = "s" size = "1" > <option selected>P-Code</option> <option...
1
by: xukaifeng | last post by:
Hi guys, I retrieve books from a database and put each book with its data into a bean. this works well, the beans are called bookBeanBeg1, bookBeanBeg2, bookBeanBeg3, bookBeanBeg4, etc. ...
2
by: Jackbyte | last post by:
plz help not sure how to put this but in the end what i would like is and increment from 1 to when ever for each letter in the alphabet this is what i have in mind psuedo a= 0 b=0 etc.....
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.