|
-
Jun 12th, 2000, 08:31 PM
#1
Thread Starter
Hyperactive Member
Ok, lets say I have 124125125.21 in text1.text......and I wanted the extension of that, which is 21...to be in label1.caption.....how would i go about doing that?
However the extension will not always remain 21, so basically it has to read after the ., so it will work for other text that is typed in...got me?
-RaY
VB .Net 2010 (Ultimate)
-
Jun 12th, 2000, 08:40 PM
#2
Try this:
Code:
Dim intPeriodPos As Integer
intPeriodPos = InStr(Text1.Text, ".")
If intPeriodPos > 0 Then
Label1.Caption = Mid$(Text1.Text, intPeriodPos + 1)
End If
"It's cold gin time again ..."
Check out my website here.
-
Jun 12th, 2000, 08:55 PM
#3
Thread Starter
Hyperactive Member
YEAHHH
Flash Gordon to the rescue!!!! Thanks Gordon, it worked....I had something similiar however it always returned the extension back as .*....but i see what you did, thanks!
-RaY
VB .Net 2010 (Ultimate)
-
Jun 12th, 2000, 10:59 PM
#4
Elegant Solution
Someone showed me this once. Elegant.
Code:
Label1.Caption = Text1.Text - CInt(Text1.Text)
A little less overhead too.
John
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|