ComboBox'tan seçilen veriye göre TextBox rengi

Katılım
6 Mart 2006
Mesajlar
251
Herkese iyi çalışmalar,

Ekte gönderdiğim dosyada bulunan UserForm üzerinde, 'kırmızı' renkli olan TextBox'lar yan taraflarında bulunan ComboBox'lardan 'ödendi' seçildiğinde renk değiştirebilirmi acaba?

Bunun için hangi kodu kullanmamız gerekiyor.Ben malesef çözemedim.

Şimdiden teşekkür ederim.
 

Orion1

Uzman
Uzman
Katılım
1 Mart 2005
Mesajlar
22,254
Excel Vers. ve Dili
Win7 Home Basic TR 64 Bit

Ofis-2010-TR 32 Bit
Ekli dosyayı inceleyiniz.:cool:
Kod:
Private Sub ComboBox2_Change()
If ComboBox2.Value = "Ödenmedi" Then
    TextBox5.BackColor = RGB(248, 52, 24)
    TextBox6.BackColor = RGB(248, 52, 24)
    TextBox7.BackColor = RGB(248, 52, 24)
End If
If ComboBox2.Value = "Ödendi" Then
    TextBox5.BackColor = RGB(123, 187, 89)
    TextBox6.BackColor = RGB(123, 187, 89)
    TextBox7.BackColor = RGB(123, 187, 89)
End If
End Sub
Kod:
Private Sub ComboBox3_Change()
If ComboBox3.Value = "Ödenmedi" Then
    TextBox5.BackColor = RGB(248, 52, 24)
    TextBox6.BackColor = RGB(248, 52, 24)
    TextBox7.BackColor = RGB(248, 52, 24)
End If
If ComboBox3.Value = "Ödendi" Then
    TextBox5.BackColor = RGB(123, 187, 89)
    TextBox6.BackColor = RGB(123, 187, 89)
    TextBox7.BackColor = RGB(123, 187, 89)
End If

End Sub
Kod:
Private Sub ComboBox4_Change()
If ComboBox4.Value = "Ödenmedi" Then
    TextBox5.BackColor = RGB(248, 52, 24)
    TextBox6.BackColor = RGB(248, 52, 24)
    TextBox7.BackColor = RGB(248, 52, 24)
End If
If ComboBox4.Value = "Ödendi" Then
    TextBox5.BackColor = RGB(123, 187, 89)
    TextBox6.BackColor = RGB(123, 187, 89)
    TextBox7.BackColor = RGB(123, 187, 89)
End If

End Sub
 
Üst