Click here to Skip to main content
15,884,836 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Good Day Fellas, I'm working right now on MDI application. I just want to ask if it is possible to change the opacity of the child form whenever it is loaded. I will put this code whenever the user move the active child form. Thank You.
Posted
Comments
BillWoodruff 29-Aug-13 5:47am    
There are a lot of people still using MDI solutions in WinForms, and you may well have been assigned to, or tasked with, creating what you describe here. However, I would encourage you to forget the idea of having a usable MdiChildForm with variable transparency, if possible. I have never seen yet seen a solution to doing this that does not have some strange problem at run-time which is just visually acceptable.

MDI architecture has been "deprecated" by Microsoft some years ago.

Unfortunately, the other alternatives are about just as bad. Putting a Form inside another Form by setting the Form to be the Parent of the other Form is a bad practice, and the Form that is now 'Parented will not use its Opacity setting. Creating a new Form, with no Parent, well, yes, you can set its Opacity as you like, but then that means that its TitleBar, and other native Form Controls (CloseBox, MinimizeBox, MaximizeBox) will share the Form's Opacity. And, if you use multiple independent Forms (something I do regularly), then, if you wish to simulate their behaving like MdiChildForms, you are in for a lot of work: imho not worth the effort, and a bad idea.

Trying to make a Panel in WinForms variably transparent, and usable is also, in my experience, going to make a mess.

"Opacity" in WinForms has never really been equivalent to what most people expect from the word "Transparency," and neither is using 'TransparencyKey along with 'BackColor.

I'd like someone to prove that everything I just said was incorrect :)

HI...

Here is the Link

Cant able to make mdi child as transparent[^]




Hope this Helps you


Happy Coding :) :)
 
Share this answer
 
Here is the idea: who needs MDI, ever? Why torturing yourself and scaring off your users?
Do yourself a great favor: do not use MDI at all. You can do much easier to implement design without it, with much better quality. MDI is highly discouraged even by Microsoft, in fact, Microsoft dropped it out of WPF and will hardly support it. More importantly, you will scare off all your users if you use MDI. Just don't. Please see:
http://en.wikipedia.org/wiki/Multiple_document_interface#Disadvantages[^],
How to Create MDI Parent Window in WPF?[^].

I can explain what to do instead. Please see my past answers:
How to Create MDI Parent Window in WPF? [Solution 2],
Question on using MDI windows in WPF[^],
MDIContainer giving error[^],
How to set child forms maximized, last childform minimized[^].

—SA
 
Share this answer
 
Comments
BillWoodruff 29-Aug-13 5:50am    
The original question, as you well know, does not involve WPF, and your response is an off-topic bloviation which is needlessly confusing to people who may be new to using WinForms. I share your distaste for MDI architecture, but your remarks here are definitely not an answer to the question asked.
Sergey Alexandrovich Kryukov 29-Aug-13 11:09am    
What are you talking about? What WPF? You probably did not read the answer properly. I mention WPF only as the example of the motivation against MDI. I cannot agree with your assessment. Not an answer? I don't care, because giving this non-answer is more important to help people than any possible "answer", to help people to stop wasting time along wrong lines. This is not "distaste". I mean it.
—SA

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