Blinking Text

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Pankaj Upmanyu
    New Member
    • Sep 2007
    • 4

    Blinking Text

    Hi I am Pankaj. I need help in displaying blinking text on a label or in a text box.I have just started learning Visual Basic.Please help
    Thanks
    Pankaj
  • hariharanmca
    Top Contributor
    • Dec 2006
    • 1977

    #2
    Originally posted by Pankaj Upmanyu
    Hi I am Pankaj. I need help in displaying blinking text on a label or in a text box.I have just started learning Visual Basic.Please help
    Thanks
    Pankaj
    You can use Timer Control and change the intervel according to the speed

    Comment

    • Robbie
      New Member
      • Mar 2007
      • 180

      #3
      As Hari said, a timer's your best bet, but since you're new to VB, I'll explain a little more...
      Add a timer to your form. Set its Interval to something around 250 (this is in milliseconds). In other words, make this number lower to make the text flash faster.

      Pretending that the label which you want to flash on/off is called Label1, in the timer's main event (i.e. when you double-click on it), type this:

      Label1.Visible = Not Label1.Visible

      That will swap it's Visible property between True and False every time it comes to that line.

      EDIT: Make sure the timer's Enabled property is set to True! (You can change it to False to stop the text flashing - just remember to set Label1.Visible back to True, in case it stops when it's invisible.)

      Comment

      • hariharanmca
        Top Contributor
        • Dec 2006
        • 1977

        #4
        Originally posted by Robbie
        As Hari said, a timer's your best bet, but since you're new to VB, I'll explain a little more...
        Thank Robbie (Do not have time to explain more).
        Last edited by Killer42; Sep 8 '07, 07:22 AM. Reason: Shortened excessive quote block

        Comment

        • Killer42
          Recognized Expert Expert
          • Oct 2006
          • 8429

          #5
          Originally posted by Robbie
          As Hari said, a timer's your best bet, but since you're new to VB, I'll explain a little more...
          Thanks Robbie.

          One handy technique I like to use in a case like this is to take advantage of the .Tag property to identify labels (or other controls) to blink. The idea is, each time your timer fires, loop through all the controls on the form. Check their Tag property and if you see a particular value in there, then switch the visibility (or background colour, or whatever you choose) of that control.

          Comment

          • Robbie
            New Member
            • Mar 2007
            • 180

            #6
            Originally posted by Killer42
            Thanks Robbie.

            One handy technique I like to use in a case like this is to take advantage of the .Tag property to identify labels (or other controls) to blink. The idea is, each time your timer fires, loop through all the controls on the form. Check their Tag property and if you see a particular value in there, then switch the visibility (or background colour, or whatever you choose) of that control.
            Hey, that's a great idea!
            I have to use that technique for something now (not for flashing text, but for something which needs to be done for many controls but I don't want to hard-code for every single one).

            Comment

            • Ali Rizwan
              Banned
              Contributor
              • Aug 2007
              • 931

              #7
              Originally posted by Pankaj Upmanyu
              Hi I am Pankaj. I need help in displaying blinking text on a label or in a text box.I have just started learning Visual Basic.Please help
              Thanks
              Pankaj
              Hi Pankaj
              Check this thing and feed me back.
              Here is a url where I have attached a file. Download it and try to modify as your needs
              Blinking text

              Comment

              Working...