Special effects in a TextBox

Does anyone know the code to make text in a TextBox scroll to the left, scroll to the right (scrolling banner), and any other special effects, like fade in and out?

Thanks

Xeifrank

Comments

  • Hi.

    I am not sure what exactly do you want to do.
    You want a transparent label (text) and fade out/in effects on it or you just want non-transparent text on a colour background?

    If the text is on a colour background you could always make "fade" effects by the RGB methods.

    For example if the background colour is black (RGB(0,0,0)) and the text is green (RGB(0,255,0)) you can do the following to fade out the sign:

    ------------------------------------------------------------------------
    '---ALL YOU HAVE TO DO IS START A NEW PROJECT WITH AN EMPTY FORM
    '---AND A LABEL CALLED "SIGN" IN IT.

    'This G is the variable for the green colour
    Dim G As Double

    Private Sub Form_Activate()
    'Since G is DOUBLE as a variable type the RGB function should be
    'protected from errors.
    On Error Resume Next
    'G is 255 - fully green
    G = 255
    'The control "SIGN" is a label
    While (G > 0)
    'Set the foreground colour of the label to RGB(0, G, 0) and
    'since G is 255 it should be 0, 255, 0.
    SIGN.ForeColor = RGB(0, G, 0)
    'The change is 0.001 because it would be too fast if it is bigger.
    'If it is too fast on your PC make it smaller.
    G = G - 0.001
    'The cycle must be stopped for a while to calculate the form
    'events.
    DoEvents
    Wend
    'When we are done we don't need this APP anymore.
    End
    End Sub
    ------------------------------------------------------------------------

    It is tested on my PC and it was OK.
    But tell me exactly what you need.
    ---------------
    Mihail Dimitrov
    ICQ : 110064098

  • : Does anyone know the code to make text in a TextBox scroll to the left, scroll to the right (scrolling banner), and any other special effects, like fade in and out?
    :
    : Thanks
    :
    : Xeifrank
    :

    I've fiddled with scrolling in QB & VB
    Lets have a go then, of the top of my head.

    intX = 30 - len(text1,text)
    text1.text = text1.text & 'Urm, what was it? str(" ", intX)? Trying to stick loads of " "s on the end of the text.
    strTest = text1.text
    'This just shoves the left charector to the end of the text box.
    text1.text = right(strTest, len(strTest)-1) & left(strTest,1)


    You might want to put that code in a timer thingy.
    That the sort of thing you want?

    Raz
    ----------------------------
    The light at the end of the tunnel is the light of and oncoming train.
    (Appologise for the messyness of it. Better then nowt eh?)
  • : Does anyone know the code to make text in a TextBox scroll to the left, scroll to the right (scrolling banner), and any other special effects, like fade in and out?
    :
    : Thanks
    :
    : Xeifrank
    :
    Set ScrollBar Property to Horizontal
  • : : Does anyone know the code to make text in a TextBox scroll to the left, scroll to the right (scrolling banner), and any other special effects, like fade in and out?
    : :
    : : Thanks
    : :
    : : Xeifrank
    : :
    :
    : I've fiddled with scrolling in QB & VB
    : Lets have a go then, of the top of my head.
    :
    : intX = 30 - len(text1,text)
    : text1.text = text1.text & 'Urm, what was it? str(" ", intX)? Trying to stick loads of " "s on the end of the text.

    STRING(INTX, " ") '<<<<<<<<<<<<<<<<<<<<<<<<<-----------------
    'That's the one! And it does kinda work, just managed to test it.

    : strTest = text1.text
    : 'This just shoves the left charector to the end of the text box.
    : text1.text = right(strTest, len(strTest)-1) & left(strTest,1)
    :
    :
    : You might want to put that code in a timer thingy.
    : That the sort of thing you want?
    :
    : Raz
    : ----------------------------
    : The light at the end of the tunnel is the light of and oncoming train.
    : (Appologise for the messyness of it. Better then nowt eh?)
    :

  • : : Does anyone know the code to make text in a TextBox scroll to the left, scroll to the right (scrolling banner), and any other special effects, like fade in and out?
    : :
    : : Thanks
    : :
    : : Xeifrank
    : :
    : Set ScrollBar Property to Horizontal

    I think he wants a sort of "news ticker" effect, where the text scrolls automatically
  • : Does anyone know the code to make text in a TextBox scroll to the left, scroll to the right (scrolling banner), and any other special effects, like fade in and out?
    :
    : Thanks
    :
    : Xeifrank
    :
    This link shows how to do it with API. I didn't try it.
    http://support.microsoft.com/default.aspx?scid=KB;EN-US;q147887&FR=0
  • : Does anyone know the code to make text in a TextBox scroll to the left, scroll to the right (scrolling banner), and any other special effects, like fade in and out?
    :
    : Thanks
    :
    : Xeifrank
    :

    Sorry if I didn't explain it well enough. I wanted to do a couple of things. First have the text (white text on black text box background) scroll from either right to left, or left to right out of the text box and then begin at the other end and keep scrolling. For example the text starts in the middle of the text box, then scrolls to the left, completely leaving the text box and then it reappears on the right side of the text box and scrolls to the left and keeps doing this thing over and over. And then maybe after a while it stops in the middle and fades in and out, then does some more scrolling. Kind of like a news ticker.

    Thanks

    Xeifrank

  • : Sorry if I didn't explain it well enough. I wanted to do a couple of things. First have the text (white text on black text box background) scroll from either right to left, or left to right out of the text box and then begin at the other end and keep scrolling. For example the text starts in the middle of the text box, then scrolls to the left, completely leaving the text box and then it reappears on the right side of the text box and scrolls to the left and keeps doing this thing over and over. And then maybe after a while it stops in the middle and fades in and out, then does some more scrolling. Kind of like a news ticker.
    :
    : Thanks
    :
    : Xeifrank
    :
    :
    Place Picture box in the form then place Textbox inside of the Picture
    box. Place Timer on the Form
    [code]Option Explicit
    Dim lpos As Integer

    Private Sub Command1_Click()
    RunNews
    End Sub

    Private Sub Timer1_Timer()
    If Text1.Left < Picture1.Width Then
    Text1.Move (Text1.Left + 20)
    Else
    Timer1.Interval = 0
    Text1.Left = 0
    RunNews
    End If
    End Sub

    Public Sub RunNews()
    If Timer1.Interval = 0 Then
    Timer1.Interval = 100
    Else
    Timer1.Interval = 0
    End If
    End Sub[/code]

  • Thanks, the code worked good for the scrolling part. I just had to make the picture box and the text box have the same background color and bring the text box to the front and turn off the border of the text box.

    Now to get the fade to work.

    Thanks

    Xei


    : : Sorry if I didn't explain it well enough. I wanted to do a couple of things. First have the text (white text on black text box background) scroll from either right to left, or left to right out of the text box and then begin at the other end and keep scrolling. For example the text starts in the middle of the text box, then scrolls to the left, completely leaving the text box and then it reappears on the right side of the text box and scrolls to the left and keeps doing this thing over and over. And then maybe after a while it stops in the middle and fades in and out, then does some more scrolling. Kind of like a news ticker.
    : :
    : : Thanks
    : :
    : : Xeifrank
    : :
    : :
    : Place Picture box in the form then place Textbox inside of the Picture
    : box. Place Timer on the Form
    : [code]Option Explicit
    : Dim lpos As Integer
    :
    : Private Sub Command1_Click()
    : RunNews
    : End Sub
    :
    : Private Sub Timer1_Timer()
    : If Text1.Left < Picture1.Width Then
    : Text1.Move (Text1.Left + 20)
    : Else
    : Timer1.Interval = 0
    : Text1.Left = 0
    : RunNews
    : End If
    : End Sub
    :
    : Public Sub RunNews()
    : If Timer1.Interval = 0 Then
    : Timer1.Interval = 100
    : Else
    : Timer1.Interval = 0
    : End If
    : End Sub[/code]
    :
    :

  • : Thanks, the code worked good for the scrolling part. I just had to make the picture box and the text box have the same background color and bring the text box to the front and turn off the border of the text box.
    :
    : Now to get the fade to work.
    :
    I think you can play with FontSize property to get it work
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories