me.visible = false problem
Hi
I've tried this code in my main form(during form_load), but the form keeps visible.
Anyone know how to make it invisible?
Tnx in advance.
Hi
I've tried this code in my main form(during form_load), but the form keeps visible.
Anyone know how to make it invisible?
Tnx in advance.
Public Class Form1
Private mAllowVisible As Boolean
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Timer1.Enabled = True
Timer1.Interval = 2000
End Sub
Protected Overrides Sub SetVisibleCore(ByVal value As Boolean)
If Not mAllowVisible Then value = False
MyBase.SetVisibleCore(value)
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
mAllowVisible = True
Visible = True
End Sub
End Class
If this is your main form then I would suggest simply minimizing it as the first line in your load:
Private
Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.LoadMe.WindowState = FormWindowState.MinimizedEnd SubIf it is not the startup form you can immediately hide the form during load:
Private
Sub Form3_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.LoadMe.Hide()End SubI guess a better question would be what are you trying to accomplish...Why "show" a form to immediately make it not visable![]()
Hi there,
Rather than trying to do this in Form_Load try doing it in Form_Activate.. Another posibility is using ShowWindow API with SW_HIDE and hWnd as the parameter will definitely work..
If this helped you pls mark as answered