اذهب الي المحتوي
أوفيسنا

how to insert timer in module - ادراج تايمر داخل الموديل بدون الحاجة الى Form1


SEMO.Pa3x

الردود الموصى بها

السلام عليكم, كما واضح في العنوان

 

Module SEMO_Pa3x
  ' c0ded by: semo.pa3x
  Sub main()
  Begin = True
  End Sub
#Region "Timer's Tick "
  Public t As New Timer
  Private Sub t_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs)
  '-----------------------------
  ' write your codes here
  '-----------------------------
  End Sub
#End Region
#Region "Begin Property "
  Public Property Begin() As Boolean
  Get
  If t.Enabled = True Then
  Return True
  Else
  Return False
  End If
  End Get
  Set(ByVal BOOL As Boolean)
  If BOOL = True Then
  If Not t.Interval = 50 Then
  With t
  AddHandler t.Tick, AddressOf t_Tick
  .Interval = 1
  .Enabled = True
  .Start()
  End With
  Else
  t.Enabled = True
  t.Start()
  End If
  Else
  t.Enabled = False
  t.Stop()
  End If
  End Set
  End Property
#End Region
End Module

 

تم تعديل بواسطه SEMO.Pa3x
رابط هذا التعليق
شارك

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

زائر
اضف رد علي هذا الموضوع....

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • اضف...

Important Information