Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / August 2005

Tip: Looking for answers? Try searching our database.

Need Help

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
AC - 17 Aug 2005 07:16 GMT
This is the description of my problems.

 I used three ways to develop irregular-shaped WinForms :
1. Firstly I set the form's FormBorderStyle property to None.
I set the form's BackColor property to Color.Black and the
Transparent key property to the same color, then I drew the form's
background using Graphics.DrawImage Method.
2. Like Method 1, I first set the form's FormBorderStyle property to
None, then I changed the form's Region property. I built the region by
building a GraphicsPath Object from a background Bitmap I used in the
application and stored it in my assembly to use it in the future.
3. I used a different way to draw the window. I drew the background
image by using Win32 Function UpdateLayeredWindow and set the form's
style to LayeredWindow.
 I got different results on them but none of them satisfied our
requirements.
a. By using the first method, I could draw the form fast but there was
black margin around the shape and when I change the background  Bitmap
in runtime the screen would flicker even though I had used
DoubleBuffer.
b. For the second method, the flickering shrinks a lot, but the
process of dragging the window cost a lot of system resources and
there was still a black margin around the Bitmap object.
c. The last method maybe the best of all, and the margin disappeared ,
the problem of resource consumption did not exist, the window didn't
flicker any more. But there was a big problem on it : the controls on
the form just "disappeared" but still could be used when I click the
controls' region(or area), the system just ignored the images of
the controls.
 The last solution seems fit us well and I want to know if there is
some
way to eliminate the problem of the last solution and make my controls
visible. Or if can not, how can I do to improve the performance of
solution 1 and 2?
 That's it. Great thanks.
AC - 18 Aug 2005 12:00 GMT
mention this http://weblogs.asp.net/cumpsd/articles/79878.aspx
<http://weblogs.asp.net/cumpsd/articles/79878.aspx>

and write this:
We tried it out, but we are still seeing similar problems:
1. the image when viewed in an image viewer doesn't have a black
boundary around it.  when it's used as the form background, there is a
black boundary.
2. when the form is dragged around, the form leaves a black shadow in
the old location, and there is a trace of such black shadow along the
path in which the form is dragged.  the trace is not permanent, as
windows will draw the background image, but it is slow.  in other
words, the trace is visible, and windows clears it too slowly.
3. in a separate effort, we tried using win32 to render the
irregularly shaped form, using the UpdateLayeredWindow method.  It
drew the form very nicely, without the black boundary, and it didn't
leave a trace when the form was dragged around.  however, the problem
was that it didn't show any controls, e.g. buttons, sliders, on it.
the controls were there but the image of the controls were not.

what we would like to achieve is similar to windows media player
(version 10), when it's shape is changed to non-rectangular.  I was
playing with it and had its shape changed to a heart.  It didn't have
any boundary.  It didn't leave a trace of the path of dragging.  there
were controls, like buttons and sliders on it.  It was exactly what we
want.  I noticed that windows media player was a win32 app, ie. not
.net framework.  my questions are:
a. can .net framework winforms do it?  if so, how?
b. how do you do it in win32 c++?
AC - 18 Aug 2005 12:03 GMT
http://weblogs.asp.net/cumpsd/articles/79878.aspx

We tried it out, but we are still seeing similar problems:
1. the image when viewed in an image viewer doesn't have a black
boundary around it.  when it's used as the form background, there is a
black boundary.
2. when the form is dragged around, the form leaves a black shadow in
the old location, and there is a trace of such black shadow along the
path in which the form is dragged.  the trace is not permanent, as
windows will draw the background image, but it is slow.  in other
words, the trace is visible, and windows clears it too slowly.
3. in a separate effort, we tried using win32 to render the
irregularly shaped form, using the UpdateLayeredWindow method.  It
drew the form very nicely, without the black boundary, and it didn't
leave a trace when the form was dragged around.  however, the problem
was that it didn't show any controls, e.g. buttons, sliders, on it.
the controls were there but the image of the controls were not.

what we would like to achieve is similar to windows media player
(version 10), when it's shape is changed to non-rectangular.  I was
playing with it and had its shape changed to a heart.  It didn't have
any boundary.  It didn't leave a trace of the path of dragging.  there
were controls, like buttons and sliders on it.  It was exactly what we
want.  I noticed that windows media player was a win32 app, ie. not
.net framework.  my questions are:
a. can .net framework winforms do it?  if so, how?
b. how do you do it in win32 c++?

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.