14. februar 2005 - 13:26
#1
det var som jeg suspectede nemt nok, jeg havede glemt at enable timeren på min form..haha
her et lille ex. hvis andre skulle få lyst til at time :)
'// user: Administrator
'// date: 14-02-2005
'// time: 12:30
Imports System
Imports System.Drawing
Imports System.Windows.Forms
Imports Microsoft.VisualBasic
Namespace timer_test
Public Class MainForm
Inherits System.Windows.Forms.Form
Private components As System.ComponentModel.IContainer
Private timer1 As System.Windows.Forms.Timer
Public Shared Sub Main
Dim fMainForm As New MainForm
fMainForm.ShowDialog()
End Sub
Public Sub New()
MyBase.New
'
' The Me.InitializeComponent call is required for Windows Forms designer support.
'
Me.InitializeComponent
'
' TODO : Add constructor code after InitializeComponents
'
End Sub
#Region " Windows Forms Designer generated code "
' This method is required for Windows Forms designer support.
' Do not change the method contents inside the source code editor. The Forms designer might
' not be able to load this method if it was changed manually.
Private Sub InitializeComponent()
Me.components = New System.ComponentModel.Container
Me.timer1 = New System.Windows.Forms.Timer(Me.components)
'
'timer1
'
Me.timer1.Enabled = true
Me.timer1.Interval = 5000
AddHandler Me.timer1.Tick, AddressOf Me.Timer1Tick
'
'MainForm
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(292, 266)
Me.Name = "MainForm"
Me.Text = "MainForm"
End Sub
#End Region
Private Sub Timer1Tick(sender As System.Object, e As System.EventArgs)
MsgBox("message")
End Sub
End Class
End Namespace