Odd textbox editing behavior
-
Windows forms, C#, Visual Studio .NET 2003. In a MDI application, we have a MDI child form that starts out maximized [window "A"]. This mdi child form has the option to open a different "editing" window as a non-modal child [window "B"]. If I set the properties "B" to be a MDI child, it will start out maximized, which we don't want. If, however, I set the properties of "B" as simply a Child of "A", then it remains a child of the MDI application (good), it remains non-maximized (good) BUT: we can no longer edit text in the text box in a "normal" fashion. :confused: The behavior is such that you can't take your cursor and highlight all of the text in the text box. You have to click in the text box, in which the cursor will force to the beginning, then you have to use your keyboard keys such as "End" and the backspace key to actually edit the text. Have tried various combinations of MDI Child but fixed borders and no control boxes and such, but the issue keeps coming up that in order to get the editing normal, it seems as if I MUST keep the form "B" as a MDI Child and thus it either maximizes, which I don't want, or it un-maximizes form "A" which I don't want. Any suggestions would be greatly appreciated. ================ Thank you Sue
-
Windows forms, C#, Visual Studio .NET 2003. In a MDI application, we have a MDI child form that starts out maximized [window "A"]. This mdi child form has the option to open a different "editing" window as a non-modal child [window "B"]. If I set the properties "B" to be a MDI child, it will start out maximized, which we don't want. If, however, I set the properties of "B" as simply a Child of "A", then it remains a child of the MDI application (good), it remains non-maximized (good) BUT: we can no longer edit text in the text box in a "normal" fashion. :confused: The behavior is such that you can't take your cursor and highlight all of the text in the text box. You have to click in the text box, in which the cursor will force to the beginning, then you have to use your keyboard keys such as "End" and the backspace key to actually edit the text. Have tried various combinations of MDI Child but fixed borders and no control boxes and such, but the issue keeps coming up that in order to get the editing normal, it seems as if I MUST keep the form "B" as a MDI Child and thus it either maximizes, which I don't want, or it un-maximizes form "A" which I don't want. Any suggestions would be greatly appreciated. ================ Thank you Sue
OK. This is all normal Windows functionality: 1) If one Child form of an MDI Parent is maximized, all the children are maximized. You can't mix it so one is maximized and other are not. 2) A Child Form cannot be both a child and a parent to another form. If you attempt to do this, the results are undefined and unpredictable, which you've already noticed. The only solution you have to both problems at the same time is to make the second child form a seperate window, with no parent. This will make the child form just like any other window with no interaction with the MDI Parent. But, I suspect you don't want this either. In that case, there is no solution to your problem. Your requirements will have to be modified to fit within the functional limitations of Windows. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
-
OK. This is all normal Windows functionality: 1) If one Child form of an MDI Parent is maximized, all the children are maximized. You can't mix it so one is maximized and other are not. 2) A Child Form cannot be both a child and a parent to another form. If you attempt to do this, the results are undefined and unpredictable, which you've already noticed. The only solution you have to both problems at the same time is to make the second child form a seperate window, with no parent. This will make the child form just like any other window with no interaction with the MDI Parent. But, I suspect you don't want this either. In that case, there is no solution to your problem. Your requirements will have to be modified to fit within the functional limitations of Windows. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
Well, this has confirmed bits and pieces of information I've found, and behavior I've experienced in other programs - my own and Microsoft's. I thank you for the explanation and it is starting to make sense. I anticipate that I will "not" be able to do exactly what I'm looking for, so I'll have to make decisions as to what is "best" for the user - not being able to edit with the mouse, or having a huge maximized screen with information only in the upper left-hand corner. Thanks for the reply.
-
Windows forms, C#, Visual Studio .NET 2003. In a MDI application, we have a MDI child form that starts out maximized [window "A"]. This mdi child form has the option to open a different "editing" window as a non-modal child [window "B"]. If I set the properties "B" to be a MDI child, it will start out maximized, which we don't want. If, however, I set the properties of "B" as simply a Child of "A", then it remains a child of the MDI application (good), it remains non-maximized (good) BUT: we can no longer edit text in the text box in a "normal" fashion. :confused: The behavior is such that you can't take your cursor and highlight all of the text in the text box. You have to click in the text box, in which the cursor will force to the beginning, then you have to use your keyboard keys such as "End" and the backspace key to actually edit the text. Have tried various combinations of MDI Child but fixed borders and no control boxes and such, but the issue keeps coming up that in order to get the editing normal, it seems as if I MUST keep the form "B" as a MDI Child and thus it either maximizes, which I don't want, or it un-maximizes form "A" which I don't want. Any suggestions would be greatly appreciated. ================ Thank you Sue
I must be misunderstanding your problem because I cant seem to see where the problem is. Lets see if I got it straight: 1)You have a MDI application with a main MDIParent Form 2)U have a MDIChild form A maximized 3)In A u have a button or whatever that opens up a Form B through Show() or ShowDialog(this) (actually, the owner will always be the MdiParent, MdiChilds cannot own forms, but the Framework will do that for u). If thats how it is then textboxes will work perfectly fine in Form B., U can select with mouse and whatever. Are u using normal TextBoxes or are u using your own derived classes?