EFileTahi-A
Contributor
Is it possible to display a window inside another window so that when I drag the main window all the other attached windows will be moved too? Plus, what about showing a window inside a panel for example?
MDI windows.EFileTahi-A said:Well, the "moving window" thing was just for ppl to get an ideia of what I was trying to say. What I really want is something like Paint Shop Pro program. If you ever saw / used this program then you will realise that the program have its own work space where it opens new windows whenever an image is loaded / created... I wonder how they do this...
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
For Each ctl As Control In Me.Controls
If TypeOf ctl Is MdiClient Then
ctl.BackColor = SystemColors.Control
Exit For
End If
Next
End Sub
jmcilhinney said:When you make a form an MDI container, it actually places an MdiClient control on your form. This means that setting the form's BackColor has no effect because it is hidden behind the MdiClient. There is no member variable for the MdiClient, however, as it is not intended to be used directly. You can change its properties, though, using code like the following:As for scrollbars, I'd say that you're stuck with them. How else would you get a window back that was moved out of view?Visual Basic:Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load For Each ctl As Control In Me.Controls If TypeOf ctl Is MdiClient Then ctl.BackColor = SystemColors.Control Exit For End If Next End Sub
jmcilhinney said:I was under the impression that the user could select Move from the system menu and move the window off screen as well, but I just tried it and it seems that you cannot move it off screen that way. It is true that if you programatically move it to a location off screen, which is unlikely but possible, the user would then have no way to access the window.
Machaira said:Sure you can:
Me.Location = New Point(10000, 0)
Wile said:Actually, you can, but you need to be a keyboard addict to find it .
If you open the system menu, select move by pressing enter, then use the direction keys, it allows me to move windows outside the desktop area. It might look like the border is still visible, but if you moved the window off the left side, move it up or down, the border that is still visible doesnt follow the up/down part, if you move the window back to the center the window however did follow the up/down key.
Dont use your mouse during all this, it completely overrides whatever you do with the keyboard .
And you can still access it as long as it is in the taskbar. Right click on it in the taskbar, select move, use the arrow keys again and it can be moved back, here the mouse becomes handy: first move the window with the arrow keys, then use the mouse: it pops into the visible area immediatly.
That is exactly how I tested. Notice that once you have the window to the edge of the screen, the only way to have it stay there is to press the ENTER key. Once you've done that, you can still access the window from sliver of border that it leaves at the edge. If the window was allowed to move off-screen and had ShowInTaskbar set to False then it would be inaccessible. I'd guess that if they were to implement MDI without scrollbars, it would be done the same way for the same reason.Wile said:Actually, you can, but you need to be a keyboard addict to find it .
If you open the system menu, select move by pressing enter, then use the direction keys, it allows me to move windows outside the desktop area. It might look like the border is still visible, but if you moved the window off the left side, move it up or down, the border that is still visible doesnt follow the up/down part, if you move the window back to the center the window however did follow the up/down key.
Dont use your mouse during all this, it completely overrides whatever you do with the keyboard .
And you can still access it as long as it is in the taskbar. Right click on it in the taskbar, select move, use the arrow keys again and it can be moved back, here the mouse becomes handy: first move the window with the arrow keys, then use the mouse: it pops into the visible area immediatly.