VB6 - How to fill an MDI with a maximized form that remains in the back of all forms throughout the application?

Hi Experts,

I have an application with an MDI form. All forms are MDI childs.

My problem: I want to fill the MDI with a form that holds some data that is displayed throughout the application, and I want this form to act like a desktop to my application; meaning, if any user clicks by mistake on the desktop I don't want other MDI children to be sent to the back of the desktop form!

Is that possible?
feesuAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

d3nCommented:
As far as I know you cannot have 1 child maximized and the other form in window state normal.
 
 You can use 1 MDI-Child window for the 'desktop' and set all other windows to MDIChild=False. Then you can use options like Form.ZOrder to keep it at the background when needed.
0
game-masterCommented:

good afternoon...
your using a maximized form to display sumthing on your application...is that what u
want?

y not use a picture box and put it on the MDI form...using that picture, u can display
sumthing and when the form pops-up it is still visible.


game-master
0
feesuAuthor Commented:
game-master,

I need to do some dynamic stuff on that desktop I'm talking about. It's not a static pic or text. I will have data displayed from a database. Is that possible?
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Antagony1960Commented:
As long as you don't need users to interact with the "desktop" form, simply use a borderless MDI child which is not enabled. You'll have to resize it manually within the main form's resize event (frmDeskTop.Move 0, 0, Me.ScaleWidth, Me.ScaleHeight).

One thing though, it will be problematic if the main form is set to use scrollbars--experiment with that and you'll see what I mean.
0
Antagony1960Commented:
Picturebox won't work because aligned controls become part of the border of the main form.
0
feesuAuthor Commented:
Experts,

There will be user interaction with the desktop form. I will have some links that could be clicked.
0
Antagony1960Commented:
Hmm, well it starts to get messy in that case. You'd have to keep track of all loaded forms and their Zorders. Then manually bring them back to the fore in the whenever the Desktop form is clicked on. I have a feeling that could look quite ugly--especially if the other child forms have any significant amount of code in their Activate events

The only other way I can think of is to have a disabled form as I suggested above and use the X, Y coordinates of main form's MouseDown event to calculate exactly where the user has clicked and whether it's within an interactive region.
0
Mike TomlinsonMiddle School Assistant TeacherCommented:
You could use a PictureBox...BUT set the Align() property to Left (can't remember exactly what it was in VB6).  Add your information/controls in the PictureBox.

This will "dock" it to the side where it will stay, always visible in your MDI apps.  The MdiChildren will appear in the remaining space off to the right.
0
game-masterCommented:


good morning!

yes Idle_Mind, that's what im talking about.
place the picture box on left, right, top, buttom depending
on ur need. Then put sumthing on the picture box that u wish to display...

By doing this all mdichild forms will be displayed on the part of the MDIForm
with no picture box..thus, all text, buttons, etc that u have placed on the
picture box will always be viewed.


game-master
0
game-masterCommented:

check this picture to give u idea.

game-master
MDIFORM.JPG
0
Antagony1960Commented:
Yes, a docked picture box would do what you both say of course, but that isn't what the author asked for. The specification was for a form which "fills" the work space and behaves like an interactive desktop.

However, from a user's perspective, I know I would find it very irritating to have to move forms about in order to get at information or functions of the application, so I would recommend feesu to go with the picture box idea.
0
feesuAuthor Commented:
Experts,
Thanks for all the comments! However, I still need to do some user interaction which will not be available with the PictureBox.

I have put a maximized form and on its GotFocus event, I change it's ZOrder. I have not found a better solution yet.
0
Antagony1960Commented:
1. User interaction is definitely available with a picture box as you place any controls on it, just as you would on a form.

2. If you do use a form its GotFocus event won't fire if you click on a control. It will be the control's GotFocus event which will fire. Unfortunately, forms don't have a pass-through property for mouse events like they do for the keyboard (KeyPreview). So you should put your ZOrder command in the Form_Activate event instead. I still think that will look ugly though.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
feesuAuthor Commented:
Thank you all!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.