
Forma eklemeniz gereken araçlar:
1 Tane button bir tane TextBox ekleyin
Eklemeniz gereken kodlar:
Private Sub Command1_Click() Command1.Caption = "değiştir" If Text1.Text = "mavi" Then Form1.BackColor = &HFF0000 End If If Text1.Text = "kırmızı" Then Form1.BackColor = &HFF& End If If Text1.Text = "yeşil" Then Form1.BackColor = &HFF00& End If If Text1.Text = "sarı" Then Form1.BackColor = &HFFFF& End If If Text1.Text = "turuncu" Then Form1.BackColor = &H80FF& End If If Text1.Text = "kahverengi" Then Form1.BackColor = &H40& End If If Text1.Text = "siyah" Then Form1.BackColor = &H0& End If If Text1.Text = "turkuaz" Then Form1.BackColor = &HFFFF00 End If If Text1.Text = "gri" Then Form1.BackColor = &H808080 End If If Text1.Text = "mor" Then Form1.BackColor = &HFF00FF End If If Text1.Text = "pembe" Then Form1.BackColor = &HFFC0FF End If End Sub
Yukarıdaki kodlar yazarak Form rengini değiştirmenizi sağlıyor şimdi renk kodları ile forma renk vermeniz gereken kodlar aşağıdadır.
Private Sub Command1_Click() Form1.BackColor = (Text1.Text) End Sub
ads
Hiç yorum yok: