?
Solved

Topmost window in MID (VB6.0)

Posted on 2002-07-03
10
Medium Priority
?
355 Views
Last Modified: 2012-06-21
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
Comment
Question by:themroc
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 2
  • 2
  • +1
10 Comments
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 7126597
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
 
LVL 6

Expert Comment

by:marconovaro
ID: 7126764

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
 

Author Comment

by:themroc
ID: 7126765
I dont quiet understand. Why should the picturebox remain always on the top of different forms which I open????
0
Independent Software Vendors: 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!

 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 7126769
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
 

Author Comment

by:themroc
ID: 7126778
I dont quiet understand. Why should the picturebox remain always on the top of different forms which I open????
0
 
LVL 4

Expert Comment

by:trkcorp
ID: 7126975
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
 

Author Comment

by:themroc
ID: 7127105
I dont quiet understand. Why should the picturebox remain always on the top of different forms which I open????
0
 

Author Comment

by:themroc
ID: 7127177
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
 
LVL 6

Accepted Solution

by:
marconovaro earned 240 total points
ID: 7127271

???

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
 

Author Comment

by:themroc
ID: 7127433
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question