• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 372
  • Last Modified:

Topmost window in MID (VB6.0)

I have cot a form called frm_OpPanel which is a MDI-Child
There are several other child in the MDI environment.
When I load this form frm_OpPanel I would like that it stays all the time on top of all other childs.

I looked up previously asked questions and I tried

frm_OpPanel.show vbModeless, Me

But the when I run in design mode it comes up with the error message
"Invalid procedure call or argument"
When I call it without the  " ,Me " than it workes but it does not stay on the top of the other forms.

What do I have to change in the coding ?????? I run it also as an execute file but it does not work neither. I also changed the statement

frm_OpPanel.show vbModeless, Me

to

frm_OpPanel.show vbModeless, frmMain
with frmMain the MDI-mother form but it works neither
?????????????????????
0
themroc
Asked:
themroc
  • 5
  • 2
  • 2
  • +1
1 Solution
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
I guess that you need some kind of form that docks to the edges of the main form?!
Then I suggest that you use a picture control instead while the "form" is docked. In order to maintain the code at a same place, create a usercontrol that you can put on the picturebox and on the form, so you keep only 1 time your code.
Docking-Undocking will just be a matter of hiding/unhiding the form/picturebox.

CHeers
0
 
marconovaroCommented:

I think that if you have to show the form always on top of the others, it should not be an MDI-child.
In this case,

frmNonMdiChild.Show , frmMain

(or frmNonMdiChild.Show , Me if we are in the MDI form)
works and shows the window as the topmost of the MDI form. This window shall be "son" of the MDI, that is it shall be minimized whenever the MDI is.

MDI-childs cannot (as far as I know) be in top of other forms....

0
 
themrocAuthor Commented:
I dont quiet understand. Why should the picturebox remain always on the top of different forms which I open????
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
I suppose that you have 1 MDI form, and the frm_OpPanel is MDI child form. If you place a picture box in the MDI form, the MDI childs will always be behind that picture box...

CHeers
0
 
themrocAuthor Commented:
I dont quiet understand. Why should the picturebox remain always on the top of different forms which I open????
0
 
trkcorpCommented:
marconovarro has stated the "proper" method to do what you tried to do, just be aware that a modal form WILL overlay the "topmost" form, whereas mdi children will not...
0
 
themrocAuthor Commented:
I dont quiet understand. Why should the picturebox remain always on the top of different forms which I open????
0
 
themrocAuthor Commented:
Thanks for your contribution!!

I set the form "frm_OpPanel" which shall be always on to as a normal form so I set MDIchild = false
but you froposed methode

frm_OpPanel.Show , Me

or

frm_OpPanel.Show , frMain

still does not work I get the errormessage
"The speciefied object cant be used as an owner form for Show()"

I also tried:
frm_OpPanel.Show vbModeless, me

but it does not work neither

MACRONOVADA: I dont quiet understand your comment:
"This window shall be "son" of the MDI, that is it shall be minimized whenever the MDI is."

angelll: That with the picture box does not work neither


Does anyone know why my comments even when I press only once appear three times on the screen??????




0
 
marconovaroCommented:

???

Did you loaded the MDI form? I tested it like this:

' In the frmMain (MDI) code:
Private Sub MDIForm_Load()
    frm_OpPanel.Show , Me
End Sub

and it works!! Let me know the error number, to give more details to you...

0
 
themrocAuthor Commented:
I did not post the statement:

frm_OpPanel.Show , Me

into the MDIForm load area for that apparently it did not work properly
now it works excelent, thanks a lot
marconovaro !!!!!!!!
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 5
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now