Solved

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

Posted on 2008-11-02
14
502 Views
Last Modified: 2012-05-05
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?
0
Comment
Question by:feesu
  • 5
  • 4
  • 3
  • +2
14 Comments
 
LVL 1

Assisted Solution

by:d3n
d3n earned 100 total points
ID: 22865190
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
 
LVL 13

Assisted Solution

by:game-master
game-master earned 100 total points
ID: 22865307

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
 

Author Comment

by:feesu
ID: 22865317
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
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
LVL 11

Expert Comment

by:Antagony1960
ID: 22865325
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
 
LVL 11

Expert Comment

by:Antagony1960
ID: 22865335
Picturebox won't work because aligned controls become part of the border of the main form.
0
 

Author Comment

by:feesu
ID: 22865336
Experts,

There will be user interaction with the desktop form. I will have some links that could be clicked.
0
 
LVL 11

Expert Comment

by:Antagony1960
ID: 22865474
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
 
LVL 85

Assisted Solution

by:Mike Tomlinson
Mike Tomlinson earned 100 total points
ID: 22867845
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
 
LVL 13

Expert Comment

by:game-master
ID: 22891938


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

Expert Comment

by:game-master
ID: 22891971

check this picture to give u idea.

game-master
MDIFORM.JPG
0
 
LVL 11

Expert Comment

by:Antagony1960
ID: 22892016
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
 

Author Comment

by:feesu
ID: 22892591
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
 
LVL 11

Accepted Solution

by:
Antagony1960 earned 200 total points
ID: 22895340
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
 

Author Comment

by:feesu
ID: 22900983
Thank you all!
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

772 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