Results 1 to 4 of 4

Thread: Label\Caption Question

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    May 2000
    Posts
    344
    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)

  2. #2
    PowerPoster BruceG's Avatar
    Join Date
    May 2000
    Location
    New Jersey (USA)
    Posts
    2,657
    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.

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    May 2000
    Posts
    344

    Talking 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)

  4. #4
    Guest

    Cool 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
  •  



Click Here to Expand Forum to Full Width