|
-
Jan 8th, 2001, 02:48 PM
#1
Thread Starter
Addicted Member
Hi,
Just want to know if there is a way to delete what one wrote with the API drawText without refreshing the screen or using the autoredraw. See, let's say I write Hello on a form and want it to write Bye in its place when user clicks a button, is there a way to delete Hello and then write again Bye.
Thanx
Phailak
-
Jan 8th, 2001, 03:41 PM
#2
Using refersh is the easy way, but if you want to erase it using API, I'm guessing you'd have to send the WM_PAINT and WM_ERASEBKGND messages.
-
Jan 9th, 2001, 07:03 AM
#3
Thread Starter
Addicted Member
Ok, thanx,
Now let's say I have 10 areas define by the Api CreatePolygons and there is some text in each. What if I want to erase the text in one of the areas only, let's say Polygon number 5 (I do have its Rgn coordonates and those of the Rect i created to write my text into)
Can I still use those messages or will that erase the whole background?
Phailak
-
Jan 10th, 2001, 09:44 PM
#4
Fanatic Member
you can do this ( i have the same problem, but this is my
solution, it works with a Rgn or a Rect structure):
Declares:
Code:
Public Declare Function RedrawWindow Lib "user32" (ByVal hwnd As Long, _
lprcUpdate As RECT, ByVal hrgnUpdate As Long, ByVal _
fuRedraw As Long) As Long
Public Declare Function RedrawWindowM Lib "user32" Alias "RedrawWindow" (ByVal hwnd As Long, lprcUpdate As _
Long, ByVal hrgnUpdate As Long, ByVal fuRedraw As Long) As _
Long
Public Declare Function DeleteObject Lib "gdi32" (ByVal _
hObject As Long) As Long
Public Const RDW_INVALIDATE = &H1
Public Const RDW_ERASE = &H4
Public Const RDW_ERASENOW = &H200
Public Const RDW_ALLCHILDREN = &H80
For Regions:
Code:
Private Sub ClearMessage(rgnBounding)
Dim retval As Long
RedrawWindowM 0, ByVal 0&, rgnBounding, RDW_INVALIDATE Or _
RDW_ERASE Or RDW_ERASENOW Or RDW_ALLCHILDREN
'refresh screen only on that point
DeleteObject rgnBounding 'delete region
End Sub
For Rects:
Code:
Private Sub ClearBox(r As RECT)
RedrawWindow 0, r, ByVal 0&, RDW_INVALIDATE Or RDW_ERASE Or _
RDW_ERASENOW Or RDW_ALLCHILDREN
'refresh screen only on that point
End Sub
GWDASH
[b]VB6, Perl, ASP, HTML, JavaScript, VBScript, SQL, C, C++, Linux , Java, PHP, MySQL, XML[b]
-
Jan 11th, 2001, 06:53 AM
#5
Thread Starter
Addicted Member
Thanx gwdash
I can work with those, it will probably erase my background right? But it doesn't matter, it will be easy to redraw
Phailak
-
Jan 11th, 2001, 07:57 AM
#6
Fanatic Member
i probably will, but only right behind the text
GWDASH
[b]VB6, Perl, ASP, HTML, JavaScript, VBScript, SQL, C, C++, Linux , Java, PHP, MySQL, XML[b]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|