Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old December 3rd, 2003, 03:58 PM
deerslayer deerslayer is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 6 deerslayer User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Angry Need help with counter

Im trying to write code that will take a number entered into text box an display 1 to that number in picture box when command button is pressed. example when 4 is entered 1234 appears in picture box. Please help

Reply With Quote
  #2  
Old December 3rd, 2003, 04:36 PM
unclefu unclefu is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 120 unclefu User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 30 m 57 sec
Reputation Power: 5
Code:

myInt = 4

for i = 0 to myInt
     MsgBox(i) 'display a stupid msgbox each time!
next


sorry for not being more specific but i haven't used VB in many years now (real VB) as ASP took over my life.

Reply With Quote
  #3  
Old December 3rd, 2003, 04:41 PM
deerslayer deerslayer is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 6 deerslayer User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
when any number is entered into text box i need the picture box to display 1 to that number. How do i do this?

Reply With Quote
  #4  
Old December 3rd, 2003, 05:01 PM
unclefu unclefu is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 120 unclefu User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 30 m 57 sec
Reputation Power: 5
ok!

Code:
for i = 0 to CInt(myTextBox.Text)
     ' i = 0...value entered in text box so do whatever with it
next


so if you enter 5 in the text box it'll count from 0 to 5, change the 0 to a 1 if you want 1 to 5 and replace the comment with whatever code you need to print the value and the value can always be accessed by the variable "i"

Reply With Quote
  #5  
Old December 4th, 2003, 09:11 PM
jbelmira jbelmira is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Location: Elmira, Ontario
Posts: 16 jbelmira User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
txtOutput.text =""
for i = 0 to CInt(myTextBox.Text)
txtOutput.text = txtOutput.text & i
next i

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming > Need help with counter


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT