EFileTahi-A Posted July 6, 2005 Posted July 6, 2005 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? Quote
Shurikn Posted July 6, 2005 Posted July 6, 2005 I dont think it is possible to include a form inside another, but you can code something that check the locacation of the mother window on the child and ajust after Quote
EFileTahi-A Posted July 6, 2005 Author Posted July 6, 2005 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... Quote
Wile Posted July 6, 2005 Posted July 6, 2005 Well' date=' 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...[/quote'] MDI windows. The 'container' (paint shop pro program) is the mdi parent, all the images that are loaded, are loaded into mdi childs. You might want to read this page (and all the pages it links to) as a starting point. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbconmdiapplications.asp Quote Nothing is as illusive as 'the last bug'.
EFileTahi-A Posted July 6, 2005 Author Posted July 6, 2005 Thank you very much Wile! I successfully applyed MDI to my program. This is Foxtrod great! I never had heard of MDI though :) Quote
jmcilhinney Posted July 7, 2005 Posted July 7, 2005 MDI = Multiple Document Interface = many documents inside one parent window SDI = Single Document Interface = each document opened in its own window Microsoft Office used to use an MDI interface but now uses SDI by default. Quote
EFileTahi-A Posted July 7, 2005 Author Posted July 7, 2005 "Additionally, be aware that the edge of the MDI parent form will pick up the system color (set in the Windows System control panel), rather than the back color you set using the Control.BackColor property." This is written within the help of .NET MSDN library, my question is, how will I change the forms backcolor then? Also, is there a way do disable the form's scroll bars when a child window reachs the edge of its parent window? Quote
jmcilhinney Posted July 7, 2005 Posted July 7, 2005 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: 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 SubAs 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? Quote
EFileTahi-A Posted July 7, 2005 Author Posted July 7, 2005 When you make a form an MDI container' date=' 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: 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 SubAs 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?[/quote'] Ok, thks for the color issue explanation. "How else would you get a window back that was moved out of view?" I answer that question of your with another question: How can you move a window out of the view at all? Can you move a window outside Windows Desktop? No, you can't, at least normaly. So? Quote
Machaira Posted July 7, 2005 Posted July 7, 2005 Sure you can: Me.Location = New Point(10000, 0) Quote Here's what I'm up to.
jmcilhinney Posted July 7, 2005 Posted July 7, 2005 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. Quote
Wile Posted July 7, 2005 Posted July 7, 2005 I was under the impression that the user could select Move from the system menu and move the window off screen as well' date=' 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.[/quote'] 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. Quote Nothing is as illusive as 'the last bug'.
EFileTahi-A Posted July 7, 2005 Author Posted July 7, 2005 Sure you can: Me.Location = New Point(10000, 0) Yes, through code is quite easy, but we were talking about from user aproach which normaly will use mouse to operate the program. Quote
EFileTahi-A Posted July 7, 2005 Author Posted July 7, 2005 (edited) 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. Well, I do have to confess that this is quite interesting though :) Edited July 8, 2005 by EFileTahi-A Quote
jmcilhinney Posted July 7, 2005 Posted July 7, 2005 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. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.