Results 1 to 6 of 6

Thread: [RESOLVED] Stop Scrolling label Flicker

Threaded View

  1. #2
    Addicted Member Witis's Avatar
    Join Date
    Jan 2011
    Location
    VB Forums Online Freedom Mode: Operational
    Posts
    213

    Re: Stop Scrolling label Flicker

    one way, is to use 2 picture boxes and BitBlt.
    steps:
    In the timer subroutine:
    1. the first picture box has the label in it and in the timer the label is moved to the left like you already have.
    2. now use the print statement to print the text directly onto the picture box (using the position of the label as the coordinates for printing the text onto the picture box)
    3. use BitBlt to copy the picture box onto which you just printed text to the other picture box, and this will stop the flicker.
    4. Hide the picture box with the label in it (it will flicker) so that you only see smooth scrolling text in the BitBlted picture box.

    Here are the declarations and an example of using BitBlt to copy from one picture box to the other.
    Code:
    Private Declare Function BitBlt Lib "gdi32" (ByVal hDestDC As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As Long
    Private Const SRCCOPY = &HCC0020
    
    BitBlt Picture1.hDC, 0, 0, Picture1.ScaleWidth, Picture1.ScaleHeight, Picture2.hDC, 0, 0, SRCCOPY
    Last edited by Witis; Mar 30th, 2012 at 09:52 PM.
    All men have an inherent right to life, the right to self determination including freedom from forced or compulsory labour, a right to hold opinions and the freedom of expression, and the right to a fair trial and freedom from torture. Be aware that these rights are universal and inalienable (cannot be given, taken or otherwise transferred or removed) although you do risk losing the aforementioned rights should you fail to uphold them e.g Charles Taylor; United Nations sources: http://www.un.org/en/documents/udhr/, http://www.ohchr.org/EN/Professional...ages/CCPR.aspx. Also Charles I was beheaded on the 30th of January of 1649 for trying to replace parliamentary democracy with an absolute monarchy, the same should happen to Dr Phil and Stephen Fry; source: http://www.vbforums.com/showthread.p...ute-Monarchism.

    The plural of sun is stars you Catholic turkeys.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width