By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
460,028 Members | 1,072 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 460,028 IT Pros & Developers. It's quick & easy.

Alphabets and numbers displayed in certain order

P: 33
i want to type Alphabets and numbers in text box in such a way
first alphabets then number
ex
C102
M458


only CM0123456789

please provide code in vb6.0
Dec 6 '08 #1
Share this Question
Share on Google+
7 Replies


lotus18
100+
P: 866
Just get the keyascii value of the keys that you pressed under the keypress event of the textbox then restrict the textbox that the first character must not accept numeric values.

Or you can use maskededit box to solve this problem


Rey Sean
Dec 6 '08 #2

P: 33
thanks
but i need a code

Char = Chr(KeyAscii)
KeyAscii = Asc(UCase(Char))

p501 = "CM0123456789" + Chr$(127) + Chr$(8)
If InStr(p501, Chr$(KeyAscii)) = 0 Then
KeyAscii = 0

how to restrict first letter should be character
Dec 8 '08 #3

debasisdas
Expert 5K+
P: 8,127
try to define a function and validate the string after user input
Dec 8 '08 #4

P: 33
i want to subtract time


Private Sub Timer1_Timer() Start Time
label1.Caption = Format(Time)
End Sub

Private Sub Timer2_Timer() End time
label2.Caption = Format(Time)
End Sub

how to subtract (End time - Start Time)

ex. 12:15:40 - 10:15:30 = 02:00:10
End time Start Time ??????
Dec 9 '08 #5

debasisdas
Expert 5K+
P: 8,127
you need to use DATEDIFF function .

DateDiff(interval, date1, date2[, firstdayofweek[, firstweekofyear]])
Where interval will be in string as
yyyy Year
q Quarter
m Month
y Day of year
d Day
w Weekday
ww Week
h Hour
n Minute
s Second
It will return difference of two dates as long according to parameters provided.
Dec 9 '08 #6

P: 33
hi
i want to make 30 days trial setup of my software (vb6.0)
please suggest me
Dec 11 '08 #7

debasisdas
Expert 5K+
P: 8,127
handle the registry at the time of installation.
Dec 11 '08 #8

Post your reply

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