Solved

Topmost window in MID (VB6.0)

Posted on 2002-07-03
10
352 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
Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

 
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 60 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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
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…
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…
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…

688 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