n00bje
Legacy Member
Vandaag eens een cursus vb.net opengedaan, alleen krijg ik 'MyForm.BackGroundColor = Color.White' niet aan de praat.
Heb MyForm al vervangen door frmDagVanDeWeek etc...
Heb MyForm al vervangen door frmDagVanDeWeek etc...
Code:
Public Class frmDagVanDeWeek
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Friend WithEvents cmdOK As System.Windows.Forms.Button
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.cmdOK = New System.Windows.Forms.Button
Me.SuspendLayout()
'
'cmdOK
'
Me.cmdOK.Location = New System.Drawing.Point(104, 96)
Me.cmdOK.Name = "cmdOK"
Me.cmdOK.TabIndex = 0
Me.cmdOK.Text = "Button1"
'
'frmDagVanDeWeek
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(292, 266)
Me.Controls.Add(Me.cmdOK)
Me.Name = "frmDagVanDeWeek"
Me.Text = "Dag van de week"
Me.ResumeLayout(False)
End Sub
#End Region
Private Sub cmdOK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdOK.Click
Dim strDag As String
Select Case Weekday(Today)
Case 1
strDag = "zondag"
Case 2
strDag = "maandag"
Case 3
strDag = "dinsdag"
Case 4
strDag = "woensdag"
Case 5
strDag = "donderdag"
Case 6
strDag = "vrijdag"
Case 7
strDag = "zaterdag"
End Select
MessageBox.Show(strDag)
End Sub
Private Sub cmdOK_MouseHover(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmdOK.MouseHover
MyForm.BackGroundColor = Color.White
End Sub
End Class


