Gambas France BETA


Pas de compte ? Incription

ColorButton

À propos de ce code

Démonstration des ColorButton

Code source

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
' Gambas class file

PUBLIC iCouleurValeur AS INTEGER

PUBLIC SUB btnQuitter_Click()

ME.Close()

END

PUBLIC SUB ButtonBox1_Click()

DIM picColor AS Picture

IF Dialog.SelectColor() THEN
ButtonBox1.Text = "Valeur de la Couleur :"
ButtonBox1.Picture = Picture["icon:/96/hue"]
ELSE
ButtonBox1.Text = "Valeur de la Couleur : " & "&H" & Hex(Dialog.Color, 6)
picColor = NEW Picture(16, 12, FALSE)
picColor.Fill(Dialog.Color)
ButtonBox1.Picture = picColor
ENDIF

END

PUBLIC SUB Form_Open()

FMain.Center
FMain.Resizable = FALSE
PictureBox1.Stretch = TRUE
ColorButton1.Color = Color.Orange
TextBox1.Text = "&H" & Hex(ColorButton1.Color, 6)

END

PUBLIC SUB ColorButton1_Change()

iCouleurValeur = ColorButton1.Color
TextBox1.Text = "&H" & Hex(ColorButton1.Color, 6)

END

Commentaires