Click here to Skip to main content
15,886,091 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to put a form in a background position ?
My first form interact with my second form which means that the buttons of my first form are in the second form...
What can I do ?



What I have tried:

Look at the picture for more details.
Posted
Updated 7-Jul-16 6:05am
Comments
TatsuSheva 7-Jul-16 11:04am    
Here is the link for the picture http://imagesia.com/user_193e8
BillWoodruff 7-Jul-16 11:31am    
You need to provide much more detail about what is happening and what your problem is. The picture appears to show a UserControl on a Form.
TatsuSheva 7-Jul-16 11:34am    
I have two forms. The first form is in MDI, when I click on the button to go to the next form, the buttons of the first form appeared on the second form like what it is in the picture.

1 solution

The problem is that that is exactly what is supposed to happen. You aren;t supposed to put controls on an MDI Parent!

Any controls on your MDI parent form have precedence over MDI child forms and will always appear in the foreground - i.e. over the top of your MDI child when they overlap.
If you want to keep this MDI, then put your buttons onto a Panel and set it's Dock property to the Left, Right, Top, or Bottom - the MDI Child forms should then initially avoid that space, so they won't overlap.

Personally? I wouldn't use MDI for new projects, it's rather outdated.
 
Share this answer
 
Comments
TatsuSheva 7-Jul-16 12:08pm    
I agree but this is the choice of my employer... I am in internship but what is the best alternatives to avoid MDI ?
OriginalGriff 7-Jul-16 12:23pm    
Well, there is the "panes" technique that Visual Studio uses - that's pretty effective, and it also "scales well" to different resolutions. Floating / docking makes it work well, and also keeps the the user happy as they can customise it to their preference.
Then there is the "multiple top-level windows" approach, where the user is free to locate the windows where he wants (and they save their positions for next time).
Or there are tabbed pages, or ... loads of different ways, really - but what you want to use will depend on what the app does, and why it's currently an MDI design.
Think about it: can you think of any new app from the last ten years that used MDI? I can't...and WPF doesn't even support it!
TatsuSheva 7-Jul-16 12:38pm    
Ah Okay I see. I will think about it and maybe bring with something new.
OriginalGriff 7-Jul-16 13:08pm    
"I have another question please if I want to create a button where when the mouse hover it the password is shown. How could I do it in c sharp ?"
Use a ToolTip:
https://msdn.microsoft.com/en-us/library/aa288412%28v=vs.71%29.aspx?f=255&MSPPError=-2147217396
TatsuSheva 7-Jul-16 13:10pm    
Ok thank you.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900