Solved

Topmost window in MID (VB6.0)

Posted on 2002-07-03
10
339 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
  • 5
  • 2
  • 2
  • +1
10 Comments
 
LVL 142

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
 
LVL 142

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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
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…

758 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now