VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Force an area to repaint

by Waty Thierry (60 Submissions)
Category: Custom Controls/Forms/Menus
Compatability: Visual Basic 4.0 (32-bit)
Difficulty: Unknown Difficulty
Originally Published: Tue 30th March 1999
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Force an area to repaint

API Declarations


' * Programmer Name : Waty Thierry
' * Web Site : www.geocities.com/ResearchTriangle/6311/
' * E-Mail : [email protected]
' * Date : 13/10/98
' * Time : 10:24
' * Module Name : Form_Module
' * Module Filename : Form.bas
' **********************************************************************
' * Comments : Force an area to repaint
' *
' **********************************************************************

Private Type POINTAPI
x As Long
y As Long
End Type

Private Declare Function GetWindowRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) As Long
Private Declare Function GetClientRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) As Long
Private Declare Function InvalidateRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT, ByVal bErase As Long) As Long
Private Declare Function ScreenToClient Lib "user32" (ByVal hwnd As Long, lpPoint As POINTAPI) As Long


Rate Force an area to repaint



' * Programmer Name  : Waty Thierry
' * Web Site         : www.geocities.com/ResearchTriangle/6311/
' * E-Mail           : [email protected]
' * Date             : 13/10/98
' * Time             : 10:24
' * Module Name      : Form_Module
' * Module Filename  : Form.bas
' **********************************************************************
' * Comments         : Force an area to repaint
' *
' **********************************************************************

Public Sub RepaintWindow(ByRef objThis As Object, Optional ByVal bClientAreaOnly As Boolean = True)
   
   ' * Programmer Name  : Waty Thierry
   ' * Web Site         : www.geocities.com/ResearchTriangle/6311/
   ' * E-Mail           : [email protected]
   ' * Date             : 30/11/98
   ' * Time             : 14:06
   ' * Module Name      : GDI_Module
   ' * Module Filename  : GDI.BAS
   ' * Procedure Name   : RepaintWindow
   ' * Parameters       :
   ' *                    ByRef objThis As Object
   ' *                    Optional ByVal bClientAreaOnly As Boolean = True
   ' **********************************************************************
   ' * Comments         : Force an area of a Window to Repaint
   ' *
   ' *
   ' **********************************************************************
   
   Dim tR   As RECT
   Dim tP   As POINTAPI
   
   If (bClientAreaOnly) Then
      GetClientRect objThis.hwnd, tR
   Else
      GetWindowRect objThis.hwnd, tR
      tP.x = tR.Left: tP.y = tR.Top
      ScreenToClient objThis.hwnd, tP
      tR.Left = tP.x: tR.Top = tP.y
      tP.x = tR.Right: tP.y = tR.Bottom
      ScreenToClient objThis.hwnd, tP
      tR.Right = tP.x: tR.Bottom = tP.y
   End If
   InvalidateRect objThis.hwnd, tR, 1
   
End Sub



Download this snippet    Add to My Saved Code

Force an area to repaint Comments

No comments have been posted about Force an area to repaint. Why not be the first to post a comment about Force an area to repaint.

Post your comment

Subject:
Message:
0/1000 characters