How can i open and close form rapidly without any showing on the screen?

  • Thread starter Thread starter nomenklatura
  • Start date Start date
N

nomenklatura

Hi,
my functions is open "x" (mdi child form) form and close then
but when i try (not exactly code):

for i=0 to 5
x.show
x.visible=false
bla
bla
x.close
next

x is first showing a little on the screen and then closen rapidly
but i don't want to see anything x form when opening an closing
how can i open and close this form behind the screen??
 
There's a difference between loading a form and showing it. You can load a
form by just doing:

Dim frm As New Form1()

If you don't call .Show it won't show on the screen, but you can still
manipulate the form in memory.
 
thanks,
but i wantto enter form_load (x form)
because , i opening another form and this y form getting data from on x
form. (example , y form use x.txtID )

normally, user open x form (which want to see information about selected
report) ,and then open y form on the x form.. y form get data from the x
form and print y form.
but user do this one by one.
i want to automaticly implement this loop

so user firs select record (multi row) which want to print records
then i automaticly do this implement for each record. but form is appear an
closing the screen

shortly , i want to opposite the application.doevents

Note: sorry my english, due to i from turkey :)
 
The solution might be to create a module or class containing the code
that is currently in the form and use that instead of the form.

The general recommendation is to place user interaction code in the
form and place the heavy-lifting code in classes that can be invoked by
forms. This allows for easier re-use.

If you are really cannot move the code, make the Form_Load handler
public and call it directly.

e.g.
x.Form_Load(nothing, nothing)


hth,
Alan.
 
nomenklatura said:
Hi,
my functions is open "x" (mdi child form) form and close then
but when i try (not exactly code):

for i=0 to 5
x.show
x.visible=false
bla
bla
x.close
next

x is first showing a little on the screen and then closen rapidly
but i don't want to see anything x form when opening an closing
how can i open and close this form behind the screen??


I think it can be done simpler than that.

x.Top = -1000;
x.Left = -1000;
x.Show();

It's gonna be "shown" but off the screen.

Nick Z.
 
Back
Top