|
-
Apr 1st, 2005, 02:10 AM
#1
Thread Starter
Addicted Member
load event
Is it possible to close a window on the load event?
-
Apr 1st, 2005, 02:16 AM
#2
-
Apr 1st, 2005, 02:18 AM
#3
Thread Starter
Addicted Member
-
Apr 1st, 2005, 02:26 AM
#4
Re: load event
Is the 'window', another application?
Bruce.
-
Apr 1st, 2005, 02:26 AM
#5
-
Apr 1st, 2005, 02:32 AM
#6
Thread Starter
Addicted Member
Re: load event
mendhak, that has no effect.
bruce fox, i have a window form and on its 'load' event i want to close it.
-
Apr 1st, 2005, 02:45 AM
#7
Thread Starter
Addicted Member
Re: load event
can somebody help me here pls?
-
Apr 1st, 2005, 02:46 AM
#8
Re: load event
huh? what is the purpose of running your program and then close it when it loads?
or am i missing something?
-
Apr 1st, 2005, 02:48 AM
#9
Re: load event
 Originally Posted by dani2
i have a window form and on its 'load' event i want to close it.
the Me.Close() that Mendhak mentioned should do it.
Have you instantiated the Form from a Module?
In any event, please post the FormX Load Event code.
Bruce.
-
Apr 1st, 2005, 02:49 AM
#10
Thread Starter
Addicted Member
Re: load event
I have a test on the 'load' event. If it fails there's no point to display it.
Can I close it?? because Me.Close() does nothing
-
Apr 1st, 2005, 02:49 AM
#11
Re: load event
 Originally Posted by mar_zim
huh? what is the purpose of running your program and then close it when it loads?
or am i missing something?
I can think of one example (I use it). When an app is opened, validate it for registration. If not valid display a dialog, and unload the Form.
Bruce.
-
Apr 1st, 2005, 02:51 AM
#12
Re: load event
 Originally Posted by dani2
I have a test on the 'load' event. If it fails there's no point to display it.
Can I close it?? because Me.Close() does nothing 
See my second post above (Post the Load Event code)
Bruce.
-
Apr 1st, 2005, 02:53 AM
#13
Thread Starter
Addicted Member
Re: load event
Ok. i found out why Me.close() is not working..
The 'Me' its a dialog 
Now, is there any other way to close this dialog on its load event?
-
Apr 1st, 2005, 02:55 AM
#14
Re: load event
 Originally Posted by Bruce Fox
I can think of one example (I use it). When an app is opened, validate it for registration. If not valid display a dialog, and unload the Form.
Bruce.
oh...he's talking about validation thingy. my bad.
sorry.
-
Apr 1st, 2005, 02:57 AM
#15
Re: load event
Is the 'Dialog' a Form you created, or is it the standard windows MsgBox/MessageBox?
Bruce.
-
Apr 1st, 2005, 02:59 AM
#16
Re: load event
 Originally Posted by mar_zim
oh...he's talking about validation thingy. my bad.
sorry.

I'm sure alot of people would have thought that after the first read 
The original question implied it too, I just supected that he/she had some idea what they wanted .
Bruce.
-
Apr 1st, 2005, 03:02 AM
#17
Thread Starter
Addicted Member
Re: load event
It is a form created that inherits
VB Code:
System.Windows.Forms.Form
I open it withAnd i want to close it before it displays anything
-
Apr 1st, 2005, 03:04 AM
#18
Thread Starter
Addicted Member
Re: load event
and yes, i do have some idea of what i want!
-
Apr 1st, 2005, 03:11 AM
#19
Re: load event
I may help if you post the code used to display that 'Dialog' Form.
And, the code in it's Load Event.
Bruce.
-
Apr 1st, 2005, 03:18 AM
#20
Thread Starter
Addicted Member
Re: load event
Really its very common code.
I open the form from another like this:
VB Code:
Dim dlgAbsences As EmployeeAbsences
dlgAbsences = New EmployeeAbsences()
dlgAbsences.ShowDialog()
and in the load event its a simple test which returns true or false. if it's false i don't want to display the form.
Me.Close() is ignored..
-
Apr 1st, 2005, 03:25 AM
#21
Re: load event
Assuming that there is a reason you don't validate prior to loading the 'Dialog'; I'm at a loss as to why the .Close() dosn't work.
I dont have .Net on this PC, so I can;t test - sorry.
Bruce.
-
Apr 1st, 2005, 03:30 AM
#22
Thread Starter
Addicted Member
Re: load event
No problem. i will make the test prior as you suggested.
thank you
-
Apr 1st, 2005, 03:34 AM
#23
Re: load event
I just pulled the ol laptop out and did a test.
It was sucessfull using a 'windows' (2nd) Form.
I suspect that it is because you inherited the Form.
Just a guess tho 
Bruce.
-
Apr 1st, 2005, 03:48 AM
#24
Addicted Member
Re: load event
Is the window you want to close a form or what?
try formX.ActiveForm.close()
where formX is name of your form.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|