Tech or Treat! Write an article about your scariest tech disaster to win gadgets!Learn more

x
?
Solved

Topmost window in MID (VB6.0)

Posted on 2002-07-03
10
Medium Priority
?
361 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
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!

 
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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

647 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