MDI Application in C# or Floating Toolbar

J

John Tyce

I am trying to convert an SDI application to MDI. I had a from with many controls on it that was an SDI application. The form is really big and requires the user to scroll back and forth and up and down to see it all. It is done this way rather than with tabs, because the user wants it that way. I created a parent container with the toolbar at the top and made other necessary changes. The application runs and my parent form starts. The child does not start. I have called frm.show() and the task bar shows two icons on top of each other (such as with Excel and the open workbook or any other MDI application), but the child does not show up. I simply have a parent with a blank background. Is there some property or something that can cause this to happen? Has anyone ever had this problem before and fixed it?
 
M

Martin Stainsby

Are you setting the Forms parent to the MDI form?

frm.MdiParent = this;
 
J

John Tyce

No I was not, thanks. I had done it in another place and then moved my code, forgetting this little line.

Another problem that I am now having, involves refreshing controls. I have allot of text boxes, several combo boxes and grids. These controls are showing live data from an Oracle database. I have dates in a combo box in my tool bar that are associated with the particular report that the user is opening. When the user picks a different date all of the data in the controls should reload. I originally built an SDI application but needed my tool bar to stay put so I redid it in MDI. In the SDI application when the user chooses a new date in the combo box, an event handler calls my load function and all of the data in the controls in reloaded with new data. In the MDI application, the new data does not show up unless I close and re show the MDI child. This of course makes the application too slow and is unacceptable. Also, I am having another problem with a control. This control is on the parent and is the dates combo box that I mentioned above. If a user clicks new report a dialog with a date time picker pops up and the user is able to select a date for the report and say OK. At this point the new date is to be inserted into the combo box (combobox.Items.Add(string)) as this happens the index of the new item is captured and the combo box is set to the new date. In the MDI application this does not happen. The combo box does not receive the new date. In fact, if I try to get a count of the items in the combo box within this event handler or a separate function, it comes back as zero, even though I can see that there are items in the list. In the SDI application, none of these problems exist. I have tried several different ways to get around this problem, and have shared it with the other developers on my team; we are all stumped. Has anyone ever seen this before? How can I fix it?
 
M

Mike McIntyre

Please post your code.

No I was not, thanks. I had done it in another place and then moved my code, forgetting this little line.

Another problem that I am now having, involves refreshing controls. I have allot of text boxes, several combo boxes and grids. These controls are showing live data from an Oracle database. I have dates in a combo box in my tool bar that are associated with the particular report that the user is opening. When the user picks a different date all of the data in the controls should reload. I originally built an SDI application but needed my tool bar to stay put so I redid it in MDI. In the SDI application when the user chooses a new date in the combo box, an event handler calls my load function and all of the data in the controls in reloaded with new data. In the MDI application, the new data does not show up unless I close and re show the MDI child. This of course makes the application too slow and is unacceptable. Also, I am having another problem with a control. This control is on the parent and is the dates combo box that I mentioned above. If a user clicks new report a dialog with a date time picker pops up and the user is able to select a date for the report and say OK. At this point the new date is to be inserted into the combo box (combobox.Items.Add(string)) as this happens the index of the new item is captured and the combo box is set to the new date. In the MDI application this does not happen. The combo box does not receive the new date. In fact, if I try to get a count of the items in the combo box within this event handler or a separate function, it comes back as zero, even though I can see that there are items in the list. In the SDI application, none of these problems exist. I have tried several different ways to get around this problem, and have shared it with the other developers on my team; we are all stumped. Has anyone ever seen this before? How can I fix it?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top