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?

[Webinar] Streamline your web hosting managementRegister Today

x
 
Antagony1960Connect With a Mentor Commented:
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
 
d3nConnect With a Mentor Commented:
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-masterConnect With a Mentor Commented:

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
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
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
 
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 TomlinsonConnect With a Mentor Middle 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
 
feesuAuthor Commented:
Thank you all!
0
All Courses

From novice to tech pro — start learning today.