1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
|
Public Class Form1
Dim cl1 As Integer
Dim cl2 As Integer
Dim cl3 As Integer
'transparence
Dim clT As Double
Public Sub New()
' Cet appel est requis par le Concepteur Windows Form.
InitializeComponent()
' Ajoutez une initialisation quelconque après l'appel InitializeComponent().
NumUpDown1.Maximum = 255
NumUpDown1.Minimum = 0
NumUpDown2.Maximum = 255
NumUpDown2.Minimum = 0
NumUpDown3.Maximum = 255
NumUpDown3.Minimum = 0
NumUpDownT.Maximum = 255
NumUpDownT.Minimum = 0
End Sub
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Panel1.BackColor = Color.FromArgb(cl1, cl2, cl3)
Panel2.BackColor = Color.FromArgb(cl1, cl2, cl3)
End Sub
Private Sub NumUpDown1_ValueChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles NumUpDown1.ValueChanged
cl1 = NumUpDown1.Value
End Sub
Private Sub NumUpDown2_ValueChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles NumUpDown2.ValueChanged
cl2 = NumUpDown2.Value
End Sub
Private Sub NumUpDown3_ValueChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles NumUpDown3.ValueChanged
cl3 = NumUpDown3.Value
End Sub
Private Sub NumUpDownT_ValueChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles NumUpDownT.ValueChanged
clT = NumUpDownT.Value
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAppliColor.Click
Panel1.BackColor = Color.FromArgb(clT, cl1, cl2, cl3)
Panel2.BackColor = Color.FromArgb(clT, cl1, cl2, cl3)
'le TextBox ne supporte pas transparence
TextBox1.BackColor = Color.FromArgb(cl1, cl2, cl3)
Panel1.Update()
Panel2.Update()
End Sub
End Class |
Partager