Click here to Skip to main content
15,907,493 members
Please Sign up or sign in to vote.
2.50/5 (2 votes)
See more:
How can made shape form by using ((( png )))image in windows appliction without using WPF
such as
http://www.codeproject.com/KB/WPF/Shaped-WPF-Form/Selection.png[^]
-------------------------------------------
thanxxxxxx
Posted

Please read the exact same question you wrote yesterday.
How can made skin for windows for application by using ((( png )))image ?[^]
You got your answer right there, so go read it and you should accept Dirk's answer. Remember to read the comments he wrote in response to your comment.
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 10-Sep-11 20:44pm    
The problem is: that answer is not enough to shape the form as shown in the referenced WPF article. Important part is missing.
Please see my solution which provides the recipe for making a specially shaped form.
--SA
ayad0net 11-Sep-11 8:39am    
Dear Simon Bang Terkildsen
i am read (( all Solution & aLL cOmmEnt )) bUt all it never right
thanxxxx
First, by "not using WPF" you might mean using System.Windows.Forms.

PNG along is not enough. You should also assign some Region to the property System.Windows.Forms.Form.Region. The Region defines what shape your form really takes, not just how it looks. When you click outside the region, some other window will be activated even if this area is inside rectangular bounds of your form. For example, you can make a form with a hole in the middle of it and see other windows through it. If you click inside this whole, the window behind your form will be activated.

See:
http://msdn.microsoft.com/en-us/library/system.windows.forms.form.aspx[^],
http://msdn.microsoft.com/en-us/library/system.windows.forms.control.region.aspx[^],
http://msdn.microsoft.com/en-us/library/system.drawing.region.aspx[^].

The type System.Drawing.Region supports set operations on set of point, so you can Union (set-theory disjunction), Intersect (conjunction), Exclude or XOR regions to produce a great variety of shapes and be able to approximate almost any desired shape.

—SA
 
Share this answer
 
Comments
Simon Bang Terkildsen 10-Sep-11 21:06pm    
+5 The reason I didn't suggest this, was simply because I wanted the OP to do it like Dirk suggested. Then he would either solve or ask for help in regards to allow for the mouse clicks to "pass though" the transparent areas, then we could guide him to SetWindowLong and talk abit about windows in Windows.

In general what I'm trying to do is to determine the level of the inquirer, if I determine the level to be low I don't want to give to much extra information, if any, but just help them solve their problem even if it goes against good practice.
I'm actually quite surprised that I haven't been able to find a discussion about this here on CP.

I'll also take this opportunity to thank you for the input you've given me the past month or so, and hope you'll continue to do so, when tripping over a not so good solution that I've provided :)
Sergey Alexandrovich Kryukov 10-Sep-11 21:39pm    
Thank you for voting and your good words. Sorry, I don't remember what past solution your mean, it happened many times.

About trying to determine the level of the inquirer... this topic is not simple at all. Let me explain my motivation of what I'm trying to do. First, in many cases it's very hard to determine the level. Also, it's very hard to make a perfect solution fast; sometimes it's better to give a good hint and let the inquirer to work on related problems. Sometimes you know that she or he will most likely face serious problems in the way you suggest and perhaps fail, but you cannot lead everyone by hand all the way; this is not a kindergarten. Perhaps it's a good exercise anyway, just to feel a scale and difficultly of a serious problem; let the strongest walk all the way to the final solution.

From the other hand, you could have noticed that I often bring nearly comprehensive amount of information somewhat beyond the question; and some object against it as it is "useless considering the level" of inquirer. Here is my answer: do you know how the principle of "presumption of innocence" works? You can always make a mistake. You can overestimate the level of inquirer; in this case this person might not understand the solution, misuse it (in some not very rare cases even down-vote the solution). But is that mistake too bad on the consequences? Consider the opposite mistake: you under-estimate the inquirer. This is worse: you did not share the knowledge this person in fact deserves. So, not providing an answer based on your estimate of the inquirer is worse than overestimation. Of course everything has reasonable measure of effort. There is one more important reason to provide a good answer even you may think it's "useless" for the inquirer: you do not share the knowledge just with the inquirer -- you use the question just as the case to share your knowledge with other people reading your post. I remember some cases when other readers had shown their gratitude for giving them right idea; sometime not directly related to original question.

I said several time that providing help to people who can use it is more important the giving the direct answer to the question. Sometimes you can really say "answering this question won't help you" and suggest to solve a different problem instead. Last year I came across a site with advice of software architects to other architects (so sorry I don't remember a link right now, hopefully I'll find it again). My favorite advice is "Don't be a problem solver". Not all problems deserve resolution. Sometimes I find it more important to address a different problem.

Thank you.
--SA
Simon Bang Terkildsen 11-Sep-11 14:27pm    
I want to point out, that I in no way am saying that there is something wrong with providing indepth information about a problem or other problems the inquierer might run into. Even if the level of the inquirer's level is to low, as there might be someone else who stumbles on the question and can take advantage of the extra information.
I agree with everything you say here, I think :)
Sergey Alexandrovich Kryukov 12-Sep-11 12:47pm    
Sure, I understand that. Thank you for reassuring me. I'll bookmark this interesting discussion for future references.
--SA
Thaxxxx for ::
1)SAKryukov
2) Simon Bang Terkildsen
and all answer me
 
Share this answer
 

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