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
492 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
 
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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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 Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

747 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

12 Experts available now in Live!

Get 1:1 Help Now