Bonjour,
je souhaité savoir s'il été possible de faire en sorte que la ScrollBar de ma RichTextBox descende toute seule au fur et à mesure que j'ajoute un élément à ma liste ?
Code Powershell : 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111 function GenerateForm { [reflection.assembly]::loadwithpartialname("System.Windows.Forms") | Out-Null [reflection.assembly]::loadwithpartialname("System.Drawing") | Out-Null $form = New-Object System.Windows.Forms.Form $btn_quit = New-Object System.Windows.Forms.Button $btn_ajout = New-Object System.Windows.Forms.Button $textBox = New-Object System.Windows.Forms.TextBox $richTextBox = New-Object System.Windows.Forms.RichTextBox $InitialFormWindowState = New-Object System.Windows.Forms.FormWindowState $btn_ajout_clic= { $richTextBox.Text=$richTextBox.Text+$textBox.Text+"`n" } $btn_quit_clic= { $form.Close() } $OnLoadForm_StateCorrection= { $form.WindowState = $InitialFormWindowState } $System_Drawing_Size = New-Object System.Drawing.Size $System_Drawing_Size.Height = 174 $System_Drawing_Size.Width = 284 $form.ClientSize = $System_Drawing_Size $form.DataBindings.DefaultDataSourceUpdateMode = 0 $form.Name = "form" $form.Text = "Liste" $btn_quit.DataBindings.DefaultDataSourceUpdateMode = 0 $System_Drawing_Point = New-Object System.Drawing.Point $System_Drawing_Point.X = 197 $System_Drawing_Point.Y = 146 $btn_quit.Location = $System_Drawing_Point $btn_quit.Name = "btn_quit" $System_Drawing_Size = New-Object System.Drawing.Size $System_Drawing_Size.Height = 23 $System_Drawing_Size.Width = 75 $btn_quit.Size = $System_Drawing_Size $btn_quit.TabIndex = 3 $btn_quit.Text = "Quitter" $btn_quit.UseVisualStyleBackColor = $True $btn_quit.add_Click($btn_quit_clic) $form.Controls.Add($btn_quit) $btn_ajout.DataBindings.DefaultDataSourceUpdateMode = 0 $System_Drawing_Point = New-Object System.Drawing.Point $System_Drawing_Point.X = 13 $System_Drawing_Point.Y = 146 $btn_ajout.Location = $System_Drawing_Point $btn_ajout.Name = "btn_ajout" $System_Drawing_Size = New-Object System.Drawing.Size $System_Drawing_Size.Height = 23 $System_Drawing_Size.Width = 75 $btn_ajout.Size = $System_Drawing_Size $btn_ajout.TabIndex = 2 $btn_ajout.Text = "Ajouter" $btn_ajout.UseVisualStyleBackColor = $True $btn_ajout.add_Click($btn_ajout_clic) $form.Controls.Add($btn_ajout) $textBox.DataBindings.DefaultDataSourceUpdateMode = 0 $System_Drawing_Point = New-Object System.Drawing.Point $System_Drawing_Point.X = 13 $System_Drawing_Point.Y = 120 $textBox.Location = $System_Drawing_Point $textBox.Name = "textBox" $System_Drawing_Size = New-Object System.Drawing.Size $System_Drawing_Size.Height = 20 $System_Drawing_Size.Width = 259 $textBox.Size = $System_Drawing_Size $textBox.TabIndex = 1 $form.Controls.Add($textBox) $richTextBox.DataBindings.DefaultDataSourceUpdateMode = 0 $System_Drawing_Point = New-Object System.Drawing.Point $System_Drawing_Point.X = 13 $System_Drawing_Point.Y = 13 $richTextBox.Location = $System_Drawing_Point $richTextBox.Name = "richTextBox" $System_Drawing_Size = New-Object System.Drawing.Size $System_Drawing_Size.Height = 96 $System_Drawing_Size.Width = 259 $richTextBox.Size = $System_Drawing_Size $richTextBox.TabIndex = 0 $richTextBox.Text = "" $richTextBox.ReadOnly=$True $form.Controls.Add($richTextBox) $InitialFormWindowState = $form.WindowState $form.add_Load($OnLoadForm_StateCorrection) $form.ShowDialog()| Out-Null } GenerateForm
Merci.
Partager