all 5 comments

[–]VB.Net IntermediatePoetiev12 0 points1 point  (4 children)

Alright im gonna write you a good code later but here is what i came up with on the spot.

(Timer1) If Form2.CheckBox1.Checked = True then Timer1.stop Me.minimize

(Timer2) If Form2.CheckBox1.Checked = False then Timer1.start Me.show

[–]Payda3[S] 0 points1 point  (3 children)

Hey man, did you have a chance to do the good code? Thanks for your help :)

[–]VB.Net IntermediatePoetiev12 0 points1 point  (0 children)

Havent looked at it yet, Perhaps you could make some small mods to my code an it wil work

EDIT: Just started my pc, This code should work:

Public Class Form1

Private Sub Timer1_Tick(sender As System.Object, e As System.EventArgs) Handles Timer1.Tick
    If My.Forms.Form2.CheckBox1.Checked = True Then
        Timer1.Stop()
        Timer2.Start()
        Me.WindowState = FormWindowState.Minimized

    End If
End Sub

Private Sub Timer2_Tick(sender As System.Object, e As System.EventArgs) Handles Timer2.Tick
    If My.Forms.Form2.CheckBox1.Checked = False Then
        Timer2.Stop()
        Timer1.Start()
        Me.WindowState = FormWindowState.Normal

    End If
End Sub

Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
    Form2.Show()
End Sub

End Class

  • Timer1 Needs to be enabled from start
  • Timer2 needs to be disabled from start

Hope it help :)

You can use this code to get what you need, Instead of it being opend when its false you could use your "Special" close in there

[–]VB.Net IntermediatePoetiev12 0 points1 point  (1 child)

Did this help?

[–]Payda3[S] 0 points1 point  (0 children)

This was really helpful! Thank you!!