none
how to make a label flash every 2 seconds.

    Question

  • I wish to have a label on my form, where on loading the form, the label1.caption = "Welcome", will flash every 1 or may be 2 seconds.

    I believe, if there was any code which can make it visible and invisible every 2 second, then it will look that way...

    I really need full code for that...

    thanks a lot in advance...
    Wednesday, November 11, 2009 12:43 PM

Answers

  • Hello , thanks for the reply , i tried Andy Pope's link from first reply.

    however i am really struggling to use that code.

    where do i copy and paste that code to .....i am very newbie, so can someone please write the code for me.

    Form1
    Label1.Caption = "A"
    Label2.Caption = "B"
    Label3.Caption = "C"
    Label4.Caption = "WELCOME"
    commandbutton1

    I have above six objects, designed ready......now i want  a code that when user press commandbutton1, the text in label4 should flash, until i unload the whole form.

    please help..


    past it in ypur timer control, double click and past the code there, that is what gonna make it flas every 1  or 2 seconds.

    let me ask you something, why do you want your label to flash every 1 or 2 second?

    Don't judge me, just Upgrade me. Thanks!
    • Marked as answer by Tim Li Monday, November 16, 2009 7:19 AM
    Thursday, November 12, 2009 8:53 PM
  • Supplement to Malange, you need add a ActiveX Timer control into your toolbox if you are not working with Access:
    http://msdn.microsoft.com/en-us/library/ms974295.aspx

    Thanks.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    • Marked as answer by Tim Li Monday, November 16, 2009 7:19 AM
    Monday, November 16, 2009 7:19 AM

All replies

  • Hi,

    Firstly I would advise against any flashing.

    What is happening whilst your form loads? Some processes can not in interupted, which is required in order to execute your flashy code.

    Here is the principle for making cell text blink.
    http://www.cpearson.com/Excel/BlinkingText.aspx
    Cheers www.andypope.info
    Wednesday, November 11, 2009 12:59 PM
  • in the form timer property, by default it is set to zero which means it is disabled, set it to 2000 (which means 2 seconds) (select the form and press alt + Enter to get properties)

    in the form timer even write

    label13.visible = not label13.visible.

    where label13 is the control which has the caption "Welcome"
    Thursday, November 12, 2009 5:36 AM
  • Form Timer Property???

    I don't see it anywhere - could you explain please?

    "The new phonebooks are here!"
    Thursday, November 12, 2009 2:46 PM
  • I believe the timer property is available to Access forms.
    Cheers www.andypope.info
    Thursday, November 12, 2009 3:26 PM
  • Hello , thanks for the reply , i tried Andy Pope's link from first reply.

    however i am really struggling to use that code.

    where do i copy and paste that code to .....i am very newbie, so can someone please write the code for me.

    Form1
    Label1.Caption = "A"
    Label2.Caption = "B"
    Label3.Caption = "C"
    Label4.Caption = "WELCOME"
    commandbutton1

    I have above six objects, designed ready......now i want  a code that when user press commandbutton1, the text in label4 should flash, until i unload the whole form.

    please help..

    Thursday, November 12, 2009 5:30 PM
  • Hello , thanks for the reply , i tried Andy Pope's link from first reply.

    however i am really struggling to use that code.

    where do i copy and paste that code to .....i am very newbie, so can someone please write the code for me.

    Form1
    Label1.Caption = "A"
    Label2.Caption = "B"
    Label3.Caption = "C"
    Label4.Caption = "WELCOME"
    commandbutton1

    I have above six objects, designed ready......now i want  a code that when user press commandbutton1, the text in label4 should flash, until i unload the whole form.

    please help..


    past it in ypur timer control, double click and past the code there, that is what gonna make it flas every 1  or 2 seconds.

    let me ask you something, why do you want your label to flash every 1 or 2 second?

    Don't judge me, just Upgrade me. Thanks!
    • Marked as answer by Tim Li Monday, November 16, 2009 7:19 AM
    Thursday, November 12, 2009 8:53 PM
  • Supplement to Malange, you need add a ActiveX Timer control into your toolbox if you are not working with Access:
    http://msdn.microsoft.com/en-us/library/ms974295.aspx

    Thanks.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    • Marked as answer by Tim Li Monday, November 16, 2009 7:19 AM
    Monday, November 16, 2009 7:19 AM
  • I just wanted the user to notice the label before reacting on any other prompts.......

    at the moment message box does the job, however I would prefer the lable to flash....thanks for your all your help.

    Monday, November 16, 2009 11:38 AM
  • To place the code:

    Click on the Form on which you placed the label with the word WELCOME.

    Press Alt + F11

    you move to CodeWindow, in which you can find two drop down list boxes, beneath the bool bar.

    select Form from the first list.

    Select Timer from the second list.

    you will find two lines shown below

    Private Sub Form_Timer()

    End Sub

    in between these two lines type the text, after that your code looks like

    Private Sub Form_Timer()
            label13.visible = not label13.visible
    End Sub

    This should solve your problem.

    Saturday, November 21, 2009 10:16 AM