Hallo und einen schönen Tag,
vielleicht erbarmt sich Einer und hilft mir bei meinem Problem.
Also ich habe 3 Pictureboxen. Nun möchte ich über alle 3 Pictureboxen eine transparente Picturebox
erstellen.
Soweit so gut. Sieht aber echt bescheiden aus. Nicht zu gebrauchen.Man kann das Ergebnis nicht lesen.
Füge ich aber innerhalb der Picturebox die rich text Box ein funktioniert es.
Aufgabe ist es aber diese Rich Text Box über die 3 Pictureboxen zu setzen.
Hier ist der momentane Code:
Option Explicit
Private Declare Function GetWindowLong _
Lib "user32" Alias "GetWindowLongA" _
(ByVal hWnd As Long, _
ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong _
Lib "user32" Alias "SetWindowLongA" _
(ByVal hWnd As Long, ByVal nIndex As Long, _
ByVal dwNewLong As Long) As Long
Private Declare Function SetWindowPos Lib "user32" _
(ByVal hWnd As Long, ByVal hWndInsertAfter As _
Long, ByVal X As Long, ByVal Y As Long, _
ByVal cx As Long, ByVal cy As Long, _
ByVal wFlags As Long) As Long
Private Const GWL_EXSTYLE As Long = (-20)
Private Const WS_EX_TRANSPARENT As Long = &H20
Private Const SWP_FRAMECHANGED = &H20
Private Const SWP_NOMOVE = &H2
Private Const SWP_NOZORDER = &H4
Private Const SWP_NOSIZE = &H1
Public Function Transparent(ByVal hWnd As Long, _
Optional ByVal Value As Boolean = True) As _
Boolean
Dim nStyle As Long
Const swpFlags As Long = _
SWP_FRAMECHANGED Or SWP_NOMOVE Or _
SWP_NOZORDER Or SWP_NOSIZE
nStyle = GetWindowLong(hWnd, GWL_EXSTYLE)
' Set new bits as desired.
If Value Then
nStyle = nStyle Or WS_EX_TRANSPARENT
Else
nStyle = nStyle And Not WS_EX_TRANSPARENT
End If
Call SetWindowLong(hWnd, GWL_EXSTYLE, nStyle)
SetWindowPos hWnd, 0, 0, 0, 0, 0, swpFlags
Transparent = _
(GetWindowLong(hWnd, GWL_EXSTYLE) = nStyle)
End Function
Private Sub Check1_Click()
Call Transparent(RichTextBox1.hWnd, _
(Check1.Value = vbChecked))
End Sub Wie kann ich es so hinbekommen das der Text der RTB über die 3 Pictureboxen geschrieben werden kann
und das mit einem guten Ergebniss.
Vielen Dank und Gruß |