Hi guys
I have this richtextbox transparent over a Picturebox which the Picutrebox is a container for a Video playback using ActiveMovie.
Richtextbox is actually suppose to show Subtitle over it. but the problem is that (in some case only) after I change the text, the old text will remain while new text is drawing, I suppose it has something to do with autoredraw which we don't have it in .net , any help about this?
This is how I made it transparent:
Any help is highly appreciated
I have this richtextbox transparent over a Picturebox which the Picutrebox is a container for a Video playback using ActiveMovie.
Richtextbox is actually suppose to show Subtitle over it. but the problem is that (in some case only) after I change the text, the old text will remain while new text is drawing, I suppose it has something to do with autoredraw which we don't have it in .net , any help about this?
This is how I made it transparent:
Code:
Private Declare Function GetWindowLong Lib "user32.dll" Alias "GetWindowLongA" _
(ByVal hwnd As Integer, ByVal nIndex As Integer) As Integer
Private Declare Function SetWindowLong Lib "user32.dll" Alias "SetWindowLongA" _
(ByVal hwnd As Integer, ByVal nIndex As Integer, ByVal dwNewLong As Integer) As Integer
Private Const GWL_EXSTYLE As Integer = -20
Private Const WS_EX_TRANSPARENT As Integer = &H20&
Private Const HWND_TOP As Integer = 0
Private Sub Preview_Load(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles MyBase.Load
Dim x As Integer = GetWindowLong(SubLayer.Handle.ToInt32, GWL_EXSTYLE)
x = x Or WS_EX_TRANSPARENT
SetWindowLong(SubLayer.Handle.ToInt32, GWL_EXSTYLE, x)
SubLayer.BringToFront()
End Sub
Any help is highly appreciated