![]() |
MDI applications in VB6.0
Hi,
My name's Jim, new to forums. Now, down to the problem I'm having. I've created an MDI form, and have 2 child forms in my application thus far. I can get the one form that acts as my main form to show, and figured out how to put the form where I want it. The second form I don't want to show until the user clicks the appropriate menu item. This is where the problem lies. I can't get the form to load no matter what I've tried. I run the program in Vstudio, and can see the form has focus in the project explorer, but it doesn't show. I've tried to move the form to MDI.top MDI.left, it doesn't show. I've minimized the main form and it minimizes. I've tried hiding the main form and it doesn't hide. I've tried showing the 2nd form from the MDI Load function, from the main form Load function and nothing. I've scoured my text book, which is horribly lacking in information other than this is how you create an MDI form and child forms. Nothing that tells you how to manipulate forms. I've searched the MSDN website and everything they have on MDI is pretty much the same thing. Is there something painfully obvious that I'm missing?:eek: Also of note, I've made Windows menus on each form, and when I try loading the 2nd form, the Windows menu isn't there. If I go back to the main form and view the Windows, the main form is the only one listed. It's like the form isn't loaded, but yet it has the focus in project explorer. If you need some code I can provide it. And I appreciate ANY help you guys can give. I've also searched these forums before posting for MDI and found 1 post, which still didn't answer my question. |
So your MDI form will show up, and so will one of the MDI Child Forms right, but the second one won't. Am I following you so far? Post the code for making the form show that you are currently having problems with. I dont remember cause I haven't done vb6 in awhile, but does the form have a visible property. If it does make sure it is set to visible.
|
MDI Form code
:
Private Sub MDIForm_Load()Main Form code :
Private Sub Form_Load()Child Form code :
Private Sub Form_Load()The main form and child form are both MDI child forms. Both are also visible. |
Well, after letting the problem cure for a day, I ran the program again just for giggles, and it worked. The only explanation I can come up with is maybe I hadn't saved the one form yet, and that's why it wouldn't load. Thanks for trying to help bigguy.
I guess maybe I should do a build from now on before trying to run my programs. |
That's kind of weird behaviour. But you'll get used to it with VB. I maintain embedded systems (quality assurance systems in production lines) for a living. Appallingly, these are all VB6 apps. Yesterday I had done about three hours worth of editing, stripping out old dead code that never gets called, fixing a few subtle but nasty issues and adding the feature I was supposed to be adding. I ran the code and set a breakpoint in a routine that was doing some database access, then when it hit the breakpoint stepped into the part where it opened the recordset. Curious as to one of the field values in the first record retrieved, stupidly I asked for it in the immediate pane, and the VB IDE promptly puked on its shoes and lost my work for me.
Another nice one is if you right click a call to a Sub or Function defined in a UserControl and choose "Definition" it gives you a message about it being impossible to jump to that on the grounds that it's hidden. Of course it isn't really, but you have to 'walk there'. VB6 is a tired old pain the arse. I love my job. I recommend C. |
| All times are GMT -5. The time now is 12:29 PM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC