Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 08-29-2021, 03:11 PM
gorkac gorkac is offline Move words from right to left on a label. I don't have the Timer control Windows 10 Move words from right to left on a label. I don't have the Timer control Office 2019
Banned
Move words from right to left on a label. I don't have the Timer control
 
Join Date: Jul 2021
Location: Usa
Posts: 62
gorkac is on a distinguished road
Default Move words from right to left on a label. I don't have the Timer control


This code works fine but it is vb 6. Do you know how to adapt it for Vba?

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
Const speed As Byte = 1
Dim wid%
Dim hei%
Dim dc&
Const text = "       HELLO WORLD!!!       "
Private Sub Form_load()

dc = Picture1.hDC

  Picture1.CurrentX = 0
  Picture1.CurrentY = 0
  Picture1.Print text
  Picture1.ScaleMode = vbPixels
  wid = Picture1.TextWidth(text)
  hei = Picture1.TextHeight(text)
  Picture1.Width = wid * Screen.TwipsPerPixelX
  Picture1.Height = hei * Screen.TwipsPerPixelY
End Sub


Private Sub Timer1_Timer()
Dim i%


  For i = 0 To speed

    BitBlt dc, wid + 1, hei + 1, 1, hei, dc, 0, 0, &HCC0020 ' &hcc0020 is equvilent to vbSrcCopy
    BitBlt dc, 0, 0, wid, hei, dc, 1, 0, &HCC0020
    BitBlt dc, wid, 0, 1, hei, dc, wid + 1, hei + 1, &HCC0020

  Next i
    Picture1.Refresh


End Sub
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to edit columns and move the right column more to the left? bchinjy Word 3 07-29-2019 05:23 AM
move the milestone label to left of column wilster31 Project 0 07-31-2017 07:58 AM
Move words from right to left on a label. I don't have the Timer control How to move page numbers left and right in header enginist Word 4 08-03-2014 09:29 PM
Move words from right to left on a label. I don't have the Timer control How to either move document display to right or left; or reduce size of find/replace window. pmstock Word 2 08-02-2014 08:34 PM
i want to place labels on to the left of the page anchored to words within soooty Word 0 07-07-2010 09:18 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 06:56 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft