Bonjour à tous,

Grace aux différents tutos trouvés sur youtube ou sur le forum, j'arrive à obtenir à peu près ce que je souhaite dans une form.
Le souci c'est que je me retrouve avec un code super long.

Y a t il un moyen pour compiler ce code svp ?

Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
        EmployeeListDataGridView.Columns(0).HeaderCell.Style.Font = New Font("SegoeUI", 9, FontStyle.Bold)
        EmployeeListDataGridView.Columns(1).HeaderCell.Style.Font = New Font("SegoeUI", 9, FontStyle.Bold)
        EmployeeListDataGridView.Columns(2).HeaderCell.Style.Font = New Font("SegoeUI", 9, FontStyle.Bold)
        EmployeeListDataGridView.Columns(3).HeaderCell.Style.Font = New Font("SegoeUI", 9, FontStyle.Bold)
        EmployeeListDataGridView.Columns(4).HeaderCell.Style.Font = New Font("SegoeUI", 9, FontStyle.Bold)
        EmployeeListDataGridView.Columns(5).HeaderCell.Style.Font = New Font("SegoeUI", 9, FontStyle.Bold)
        EmployeeListDataGridView.Columns(6).HeaderCell.Style.Font = New Font("SegoeUI", 9, FontStyle.Bold)
        EmployeeListDataGridView.Columns(7).HeaderCell.Style.Font = New Font("SegoeUI", 9, FontStyle.Bold)
        EmployeeListDataGridView.Columns(8).HeaderCell.Style.Font = New Font("SegoeUI", 9, FontStyle.Bold)
 
 
        EmployeeListDataGridView.Columns(0).DefaultCellStyle.Font = New Font("SegoeUI", 9, FontStyle.Bold)
        EmployeeListDataGridView.Columns(1).DefaultCellStyle.Font = New Font("SegoeUI", 9, FontStyle.Bold)
        EmployeeListDataGridView.Columns(2).DefaultCellStyle.Font = New Font("SegoeUI", 9)
        EmployeeListDataGridView.Columns(3).DefaultCellStyle.Font = New Font("SegoeUI", 9)
        EmployeeListDataGridView.Columns(4).DefaultCellStyle.Font = New Font("SegoeUI", 9)
        EmployeeListDataGridView.Columns(5).DefaultCellStyle.Font = New Font("SegoeUI", 9)
        EmployeeListDataGridView.Columns(6).DefaultCellStyle.Font = New Font("SegoeUI", 9)
        EmployeeListDataGridView.Columns(7).DefaultCellStyle.Font = New Font("SegoeUI", 9)
        EmployeeListDataGridView.Columns(8).DefaultCellStyle.Font = New Font("SegoeUI", 9)
 
 
        EmployeeListDataGridView.EnableHeadersVisualStyles = False
        EmployeeListDataGridView.Columns(1).HeaderCell.Style.BackColor = Color.Black
        EmployeeListDataGridView.Columns(2).HeaderCell.Style.BackColor = Color.Black
        EmployeeListDataGridView.Columns(3).HeaderCell.Style.BackColor = Color.Black
        EmployeeListDataGridView.Columns(4).HeaderCell.Style.BackColor = Color.Black
        EmployeeListDataGridView.Columns(5).HeaderCell.Style.BackColor = Color.Black
        EmployeeListDataGridView.Columns(6).HeaderCell.Style.BackColor = Color.Black
        EmployeeListDataGridView.Columns(7).HeaderCell.Style.BackColor = Color.Black
        EmployeeListDataGridView.Columns(8).HeaderCell.Style.BackColor = Color.Black
 
        EmployeeListDataGridView.Columns(1).HeaderCell.Style.SelectionBackColor = Color.Black
        EmployeeListDataGridView.Columns(2).HeaderCell.Style.SelectionBackColor = Color.Black
        EmployeeListDataGridView.Columns(3).HeaderCell.Style.SelectionBackColor = Color.Black
        EmployeeListDataGridView.Columns(4).HeaderCell.Style.SelectionBackColor = Color.Black
        EmployeeListDataGridView.Columns(5).HeaderCell.Style.SelectionBackColor = Color.Black
        EmployeeListDataGridView.Columns(6).HeaderCell.Style.SelectionBackColor = Color.Black
        EmployeeListDataGridView.Columns(7).HeaderCell.Style.SelectionBackColor = Color.Black
        EmployeeListDataGridView.Columns(8).HeaderCell.Style.SelectionBackColor = Color.Black
 
 
        EmployeeListDataGridView.Columns(1).HeaderCell.Style.ForeColor = Color.White
        EmployeeListDataGridView.Columns(2).HeaderCell.Style.ForeColor = Color.White
        EmployeeListDataGridView.Columns(3).HeaderCell.Style.ForeColor = Color.White
        EmployeeListDataGridView.Columns(4).HeaderCell.Style.ForeColor = Color.White
        EmployeeListDataGridView.Columns(5).HeaderCell.Style.ForeColor = Color.White
        EmployeeListDataGridView.Columns(6).HeaderCell.Style.ForeColor = Color.White
        EmployeeListDataGridView.Columns(7).HeaderCell.Style.ForeColor = Color.White
        EmployeeListDataGridView.Columns(8).HeaderCell.Style.ForeColor = Color.White