- Katılım
- 5 Kasım 2006
- Mesajlar
- 602
- Excel Vers. ve Dili
- TÜRKCE Excel 2021 32bit
Merhaba.
Class ile aktif textboxu renklendirdim.
Yapamadığım şey örnek olarak resimdeki gibi renkli textboxların renkleri aynı kalması textboxtan ayrılınca.
Örnekte maus userforma gelince taextbox rengi beyaz oluyor normalde textbox renk ne ise o olmalı.
https://dosya.co/ff9osyzs30kj/Classs_Textbox_Renk.xlsm.html

Class ile aktif textboxu renklendirdim.
Yapamadığım şey örnek olarak resimdeki gibi renkli textboxların renkleri aynı kalması textboxtan ayrılınca.
Örnekte maus userforma gelince taextbox rengi beyaz oluyor normalde textbox renk ne ise o olmalı.
https://dosya.co/ff9osyzs30kj/Classs_Textbox_Renk.xlsm.html

PHP:
Dim sec() As New TextClass
Private Sub UserForm_Initialize()
Dim a As Byte
For Each aa In Me.Controls
If TypeName(aa) = "TextBox" Then
a = a + 1
ReDim Preserve sec(a)
Set sec(a).textboxx = aa
End If
Next
End Sub
Private Sub UserForm_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
Dim a As Byte
For Each aa In Me.Controls
If TypeOf aa Is MSForms.TextBox Then
aa.BackColor = vbWhite
End If
Next
End Sub
PHP:
Public WithEvents textboxx As MSForms.TextBox
Private Sub textboxx_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
Dim Ctrl As Control
For Each Ctrl In UserForm1.Controls
If TypeName(Ctrl) = "TextBox" Then
Ctrl.BackColor = vbWhite
End If
Next
textboxx.BackColor = vbYellow
End Sub