Moving of texts

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Zelalem
    New Member
    • Nov 2006
    • 19

    Moving of texts

    Hi...

    1.Can i move texts, pictures in the VB.6 interace? As in <Marquee > is used in html.
  • srikanthtenali
    New Member
    • Jan 2007
    • 1

    #2
    Originally posted by Zelalem
    Hi...

    1.Can i move texts, pictures in the VB.6 interace? As in <Marquee > is used in html.
    Yes you can do that, simply flow the below code

    Dim int1 As Integer
    Private Sub Timer1_Timer()
    If int1 = Len(......some text.......) Then int1 = 1
    TxtFlash = Mid(StrFlash, int1, Len(StrFlash)) & StrFlash
    int1 = int1 + 1
    End Sub

    Comment

    • Killer42
      Recognized Expert Expert
      • Oct 2006
      • 8429

      #3
      Originally posted by Zelalem
      Can i move texts, pictures in the VB.6 interace? As in <Marquee > is used in html.
      I don't think VB has a scrolling textbox control, but you can do it yourself with a bit of code (see response from srikanthtenali for a sample). I think there is an animation control which will show an animated GIF file or a movie.

      Comment

      • Zelalem
        New Member
        • Nov 2006
        • 19

        #4
        Originally posted by srikanthtenali
        Yes you can do that, simply flow the below code

        Dim int1 As Integer
        Private Sub Timer1_Timer()
        If int1 = Len(......some text.......) Then int1 = 1
        TxtFlash = Mid(StrFlash, int1, Len(StrFlash)) & StrFlash
        int1 = int1 + 1
        End Sub

        I tried it, but i faild to do so and come up with the following queston.
        Can you say something why it does not work ?

        Comment

        • snowwwolf
          New Member
          • Jan 2007
          • 28

          #5
          Originally posted by Zelalem
          I tried it, but i faild to do so and come up with the following queston.
          Can you say something why it does not work ?
          Dim _MoveLeft
          Private Sub Timer1_Timer()
          If Label1.Left < 0 Then _MoveLeft = False
          If Label1.Left > Me.Width - Label1.Width Then _MoveLeft = True
          If _MoveLeft Then
          Label1.Left = Label1.Left - 10
          Else
          Label1.Left = Label1.Left + 10
          End If
          End Sub

          Note : first you must set interval value and set true to enable property to timer1

          hope this help,

          <X>

          Comment

          • Killer42
            Recognized Expert Expert
            • Oct 2006
            • 8429

            #6
            Originally posted by Zelalem
            I tried it, but i faild to do so and come up with the following queston.
            Can you say something why it does not work ?
            I haven't tried that code myself, but one thing stands out. If you tried to use it exactly as it was shown here, the ......some text....... would cause an error because it needs quotes (") around it to make it a string literal. srikanthtenali just used it as a placeholder to show where you should place your text string.

            Comment

            • Killer42
              Recognized Expert Expert
              • Oct 2006
              • 8429

              #7
              On further consideration, I think there are further problems with that code. Try snowwwolf's, and see how it goes. The difference is that the first method was trying to chop up a string and stick the parts of it together differently, while snowwwolf is simply moving a label on the form. Both techniques probably have their good and bad points.

              I believe the best thing for you to do at this point would be to take the ideas that have been provided, and play with them. You'll learn much more that way than if we just hand you a solution.

              Comment

              Working...