Public Class Form
Cours : Public Class Form. Recherche parmi 300 000+ dissertationsPar AD.mimi98 • 10 Février 2019 • Cours • 5 075 Mots (21 Pages) • 494 Vues
[pic 1]
Public Class Form1
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
Me.BackColor = Color.DarkGreen
End Sub
Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click
Me.BackColor = Color.DarkRed
End Sub
Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
End Sub
End Class
[pic 2]
Public Class Form1
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
Dim c1 As Double = TextBox2.Text
Dim c2 As Double = TextBox4.Text
Dim c3 As Double = TextBox6.Text
Dim s As Double = c1 + c2 + c3
Label6.Text = ((TextBox1.Text * c1) + (TextBox3.Text * c2) + (TextBox5.Text * c3)) / s
If (Label6.Text >= 16) Then
Label7.Text = "tres bien"
ElseIf (Label6.Text >= 14) Then
Label7.Text = "bien"
ElseIf (Label6.Text >= 12) Then
Label7.Text = "assez bien"
ElseIf (Label6.Text >= 10) Then
Label7.Text = "passabe"
Else
Label6.Text = "non-admis"
End If
End Sub
Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click
Application.Exit()
End Sub
End Class
Public Class Form1[pic 3]
Dim msg As String = ""
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
If (CheckBox1.Checked = True) Then
msg = msg + CheckBox1.Text
End If
If (CheckBox2.Checked = True) Then
msg = msg + CheckBox2.Text
End If
If (CheckBox3.Checked = True) Then
msg = msg + CheckBox3.Text
End If
If (CheckBox4.Checked = True) Then
msg = msg + CheckBox4.Text
End If
MessageBox.Show(msg, "message impotant")
End Sub
End Class
Public Class Form1[pic 4]
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
Dim msg As String = ""
If (RadioButton1.Checked = True) Then
msg = msg + vbCrLf + RadioButton1.Text
End If
If (RadioButton2.Checked = True) Then
msg = msg + vbCrLf + RadioButton2.Text
End If
If (RadioButton3.Checked = True) Then
msg = msg + vbCrLf + RadioButton3.Text
End If
If (RadioButton4.Checked = True) Then
msg = msg + vbCrLf + RadioButton4.Text
End If
If (RadioButton5.Checked = True) Then
msg = msg + vbCrLf + RadioButton5.Text
...