Newbie: Show child window

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

H

I'm just a confused newbie, so please excuse this question: In one of my click- handlers of my main form, the following shall happen: A new window shall appear, that gives the user some information about what the main thread is doing (some status). But which "Show" function shall I use

I declared the class of the status window
Dim stat as new Status(

stat.Show() 'This does not display all of the controls in the status window correctl
stat.ShowDialog(Me) 'This does not return to the parent window, so actually no work is don
stat.SetText("This is my test...") 'self-written member function, sets the text of a status label in the status windo

Can anyone help me with this

Thank
Gordon
 
Hi Grodon

If I understand you well

Dim stat as new Status()
stat.Text("This is my test ")
stat.ShowDialog(Me)
stat.dispose

This should be enough, when the user closes your stat form it comes back in
the place stat.dispose.

I hope this helps,

Cor
 
Thanks, but what I meant was something else

The child window (status window) shall run independent from the parent window as long as its visible. The code in the parent form shall NOT stop after the status window is shown, but continue. That's why I can't use ShowDialog()
By the way, the status form actually also contains a progress bar, so have to be able to access the child form from the parent form, to set the current progress of my work

Grodon
 
Hi Grodon,

You mean?

Private stat as new Status() 'in the top of your program above the first sub
(or function)
stat.Text("This is my test ")
stat.Show


At the end of the program
stat.close

Cor
 
Basically yes

The problem is, that, if I do it this way, the controls in the status form are not drawn correctly (black areas instead of labels or progressbars)

Any ideas

Thank
Gordon
 
if some of the controls arent loading then have you checked out the code
that loads them?

do these labels etc load properly if loaded normally?


Gordon Knote said:
Basically yes.

The problem is, that, if I do it this way, the controls in the status form
are not drawn correctly (black areas instead of labels or progressbars).
 
also ...

instead of adjusting your control from your main form..

why not wire up a event that your child form will listen to .... then the
childform can handle all the status events and you dont have to worry about
a reference to it. as you can just create your child and away you go .

Do that by either setting a property on your child form that will get the
events.
stat.ObjEvents = mainForm.StatEvents



Gordon Knote said:
Basically yes.

The problem is, that, if I do it this way, the controls in the status form
are not drawn correctly (black areas instead of labels or progressbars).
 
Good idea. I'll think about this.
But still, the controls are not drawn correctly if I use Show(), but perfectly if I use ShowDialog(). Any ideas about that?

Gordon
 
Gordon said:
Good idea. I'll think about this.
But still, the controls are not drawn correctly if I use Show(), but perfectly if I use ShowDialog(). Any ideas about that?

Gordon

Did this ever get resolved? I want to have a status form appear while
other things are happening. I'm running into the same problem that
you're describing.

TIA
 
Back
Top