Log inUsernamePassword
Log me on automatically each visit    
Register
Register
Log in to check your private messages
Log in to check your private messages
Visual Basic Forum for Visual Basic Programmers VB Forum Index » General

Post new topic   Reply to topic
label intergers I want 01 not 1
View previous topic :: View next topic  
Author Message
Downtown
Newbie


Joined: 06 Dec 2003
Posts: 10

PostPosted: Dec 6th, 2003 11:12 AM    Post subject: label intergers I want 01 not 1 Reply with quote

Hi, I need help in changing my properties of my labels. I use the randomize to get numbers for labels, then print the numbers in the labels on the screen before printing the paper copy. It is messy when the columns are crooked. I want all int to be 2 places 01, -09 , not 1-9. Can't seem to find how to change this in porperties. Must I did it when I set the dim? Would one use int1 = int01? Probly not.
Thanks in advance,
Dale
Back to top
View user's profile Send private message Send e-mail
Avis
Junior Poster


Joined: 07 Oct 2003
Posts: 510
Location: India

PostPosted: Dec 6th, 2003 12:04 PM    Post subject: Reply with quote

Hi!

You can use the following to change all your ints to be 2 places. So if you get 1 you can do it like

Code:
Dim A As Integer

A = 1
If A <= 1 Or A >= 9 Then A = "0" & A

MsgBox A


This will change 1 to 01!

Hope this helps!
_________________
Code Snippets, Tutorials, Utilities, Controls

Low cost Web Hosting
Hosting starts at as low as $4 per year!


Always follow posting guidelines
Put your VB code in [vb ] your code [ /vb] tags!
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger ICQ Number
Downtown
Newbie


Joined: 06 Dec 2003
Posts: 10

PostPosted: Dec 6th, 2003 06:45 PM    Post subject: Reply with quote

Centurion,
I will try this, only I will use Label, in place of MsgBox.
Thanks in advance,
Downtown
_________________
We can not change the past, the best we can hope for is to influence the future.
Back to top
View user's profile Send private message Send e-mail
Algar
Newbie


Joined: 16 Oct 2003
Posts: 20

PostPosted: Dec 7th, 2003 02:58 PM    Post subject: Reply with quote

Downtown - Avis is his name, Centurion is his status.
_________________
The McDonald's are starting to get really bad around here. I found a handgun in my cheeseburger yesterday.
Back to top
View user's profile Send private message Send e-mail AIM Address
Downtown
Newbie


Joined: 06 Dec 2003
Posts: 10

PostPosted: Dec 7th, 2003 10:30 PM    Post subject: Reply with quote

Thanks, I was easly confused. I have solved the problem with his help. I modified the code and used it in two of my
applications to create Power ball numbers.
Thanks to all,
Downtown
_________________
We can not change the past, the best we can hope for is to influence the future.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Visual Basic Forum for Visual Basic Programmers VB Forum Index » General All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Visual Basic Forum runs phpBB | Forum Template © iOptional
VB Resources | SSL | Visual Basic