Sliding text but not sliding label or textbox

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Ali Rizwan
    Banned
    Contributor
    • Aug 2007
    • 931

    Sliding text but not sliding label or textbox

    Hi
    I want to slide my text as in news but not wanna slide my label or textbox control.
  • hariharanmca
    Top Contributor
    • Dec 2006
    • 1977

    #2
    Originally posted by Ali Rizwan
    Hi
    I want to slide my text as in news but not wanna slide my label or textbox control.

    Use
    1. timer Control

    [CODE=VB]Dim strActualValue As String
    Private Sub Form_Load()
    strActualValue = "12345678901234 567890123456789 0"
    End Sub

    Private Sub Timer1_Timer()
    lblName.Caption = Mid(strActualVa lue, InStr(1, strActualValue, Trim(lblName.Ca ption)) + 1, 5)
    End Sub[/CODE]
    Last edited by hariharanmca; Aug 27 '07, 12:25 PM. Reason: Removed code (Checking for correct one)

    Comment

    • QVeen72
      Recognized Expert Top Contributor
      • Oct 2006
      • 1445

      #3
      Hi,

      Add a Label On the Form and Rename it as LStat
      Add a Timer Control and Set Interval =2000 (2 seconds) and write this code in Timer1_Timer Event :
      Declare a FormLevel Variable at the top of the Form :

      Dim TPos As Integer

      [code=vb]
      Dim mystr As String
      mystr = "Wow !! Look, This Text Is Sliding.."
      If TPos = 0 Or TPos > Len(mystr) Then TPos = 1
      LStat.Caption = Mid(mystr, TPos)
      TPos = TPos + 1
      [/code]


      Regards
      Veena

      Comment

      • hariharanmca
        Top Contributor
        • Dec 2006
        • 1977

        #4
        Originally posted by QVeen72
        Hi,

        Add a Label On the Form and Rename it as LStat
        Add a Timer Control and Set Interval =2000 (2 seconds) and write this code in Timer1_Timer Event :
        Declare a FormLevel Variable at the top of the Form :

        Dim TPos As Integer

        [code=vb]
        Dim mystr As String
        mystr = "Wow !! Look, This Text Is Sliding.."
        If TPos = 0 Or TPos > Len(mystr) Then TPos = 1
        LStat.Caption = Mid(mystr, TPos)
        TPos = TPos + 1
        [/code]


        Regards
        Veena
        He/She is looking for Moving text like Marquee Text in HTML.


        [CODE=vb]Private Sub Timer1_Timer()
        lblName.Caption = Mid(strActualVa lue, InStr(1, strActualValue, Trim(lblName.Ca ption)) + 1, 5)
        End Sub[/CODE]

        This will help him

        Comment

        • QVeen72
          Recognized Expert Top Contributor
          • Oct 2006
          • 1445

          #5
          Originally posted by hariharanmca
          He/She is looking for Moving text like Marquee Text in HTML.


          [CODE=vb]Private Sub Timer1_Timer()
          lblName.Caption = Mid(strActualVa lue, InStr(1, strActualValue, Trim(lblName.Ca ption)) + 1, 5)
          End Sub[/CODE]

          This will help him
          Hi,

          Even My Code was for that only, I told him to change the Label Name to "LStat"
          Read my post completely..

          REgards
          Veena

          Comment

          • hariharanmca
            Top Contributor
            • Dec 2006
            • 1977

            #6
            Originally posted by QVeen72
            Hi,

            Even My Code was for that only, I told him to change the Label Name to "LStat"
            Read my post completely..

            REgards
            Veena
            Yes, But you never mension the method is in timer (Ther we can contron the speed in intervel).

            Comment

            • QVeen72
              Recognized Expert Top Contributor
              • Oct 2006
              • 1445

              #7
              Originally posted by hariharanmca
              Yes, But you never mension the method is in timer (Ther we can contron the speed in intervel).
              Check this :

              Code:
              Add a Timer Control and Set Interval =2000 (2 seconds) and write this code in [B]Timer1_Timer Event [/B] :
              REgards
              Veena

              Comment

              • hariharanmca
                Top Contributor
                • Dec 2006
                • 1977

                #8
                Originally posted by QVeen72
                Check this :

                Code:
                Add a Timer Control and Set Interval =2000 (2 seconds) and write this code in [B]Timer1_Timer Event [/B] :
                REgards
                Veena
                Hoh...No.Sorry, I didn't read your Post properly. Its okay.

                Comment

                • Ali Rizwan
                  Banned
                  Contributor
                  • Aug 2007
                  • 931

                  #9
                  Thanks to all who answer my questions

                  Comment

                  Working...