473,407 Members | 2,315 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Shaped Forms

Hi guys,

I am writing an app that I wish to have a transparent background and hence a
shaped form. In the
InitializeComponent() method I set the members of the form to the following:

//-- Code -------------------------------------------

this.FormBorderStyle = FormBorderStyle.None;
this.MaximizeBox = false;
this.BackColor = Color.FromArgb(((System.Byte)(128)), ((System.Byte)(128)),
((System.Byte)(255)));
this.TransparencyKey = Color.FromArgb(((System.Byte)(128)),
((System.Byte)(128)), ((System.Byte)(255)));

//-- End of Code ------------------------------------

I am then drawing graphics of a clock as per
http://www.publicjoe.f9.co.uk/csharp...nalogclock.exe
application.

This works great under windows 2000, but not XP. Can someone please point me
in the right direction.

Full code can be seen at
http://www.publicjoe.f9.co.uk/csharp...analogclock.cs

Thanks in advance

Publicjoe

Nov 16 '05 #1
4 2453
What doesn't work? My shaped form with a transparency key works a treat
under XP...

--
Bob Powell [MVP]
Visual C#, System.Drawing

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

"Publicjoe" <mi**@publicjoe.co.uk> wrote in message
news:ee**************@TK2MSFTNGP15.phx.gbl...
Hi guys,

I am writing an app that I wish to have a transparent background and hence
a
shaped form. In the
InitializeComponent() method I set the members of the form to the
following:

//-- Code -------------------------------------------

this.FormBorderStyle = FormBorderStyle.None;
this.MaximizeBox = false;
this.BackColor = Color.FromArgb(((System.Byte)(128)),
((System.Byte)(128)),
((System.Byte)(255)));
this.TransparencyKey = Color.FromArgb(((System.Byte)(128)),
((System.Byte)(128)), ((System.Byte)(255)));

//-- End of Code ------------------------------------

I am then drawing graphics of a clock as per
http://www.publicjoe.f9.co.uk/csharp...nalogclock.exe
application.

This works great under windows 2000, but not XP. Can someone please point
me
in the right direction.

Full code can be seen at
http://www.publicjoe.f9.co.uk/csharp...analogclock.cs

Thanks in advance

Publicjoe

Nov 16 '05 #2
Hi Bob,

In the linked file, I use GDI+ to draw on the form.
http://www.publicjoe.f9.co.uk/csharp...analogclock.cs

On my other PC running XP, I get a light blue background around the clock
from the above code. On windows 2000, I see the background of the destop or
other application that is there instead. Weird!

If you could compile the code above into an app and let me know what you see
on XP, I would be grateful.

I will have a look at your code that you attached to the other email later
to see how you use a bitmap to do shaped forms.

Cheers

Publicjoe

"Bob Powell [MVP]" <bob@_spamkiller_bobpowell.net> wrote in message
news:O0**************@TK2MSFTNGP12.phx.gbl...
What doesn't work? My shaped form with a transparency key works a treat
under XP...

--
Bob Powell [MVP]
Visual C#, System.Drawing

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

"Publicjoe" <mi**@publicjoe.co.uk> wrote in message
news:ee**************@TK2MSFTNGP15.phx.gbl...
Hi guys,

I am writing an app that I wish to have a transparent background and hence a
shaped form. In the
InitializeComponent() method I set the members of the form to the
following:

//-- Code -------------------------------------------

this.FormBorderStyle = FormBorderStyle.None;
this.MaximizeBox = false;
this.BackColor = Color.FromArgb(((System.Byte)(128)),
((System.Byte)(128)),
((System.Byte)(255)));
this.TransparencyKey = Color.FromArgb(((System.Byte)(128)),
((System.Byte)(128)), ((System.Byte)(255)));

//-- End of Code ------------------------------------

I am then drawing graphics of a clock as per
http://www.publicjoe.f9.co.uk/csharp...nalogclock.exe
application.

This works great under windows 2000, but not XP. Can someone please point me
in the right direction.

Full code can be seen at
http://www.publicjoe.f9.co.uk/csharp...analogclock.cs

Thanks in advance

Publicjoe


Nov 16 '05 #3
Publicjoe,

Both computers have a max of 24bits colorquality?

Cor
Nov 16 '05 #4
I will check the machine at home. The Windows 2000 machine is running 16bit
colour. It may be that I am running 32 bit on XP.

Thanks

Publicjoe

"Cor Ligthert" <no************@planet.nl> wrote in message
news:Ot**************@TK2MSFTNGP15.phx.gbl...
Publicjoe,

Both computers have a max of 24bits colorquality?

Cor

Nov 16 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: skullcap | last post by:
Is there any way using HTML 4.01 of wrapping text and other inline elements into an 'L' or 'C' shaped space in a table - i.e. telling the browser that a series of table cells which don't form a...
5
by: vBOT | last post by:
Hi all, I have an odd shaped graphic I would like to use as my interface (see it here at http://www.mokee.com/vbot/ver3/face.jpg) The part I want to be transparent on the image is red. I set the...
3
by: James | last post by:
I have an picture cut out in a certain shape that I would like to make as my form. I have tried following the directions in MSDN on how to make shaped windows forms but their directions did not work...
2
by: Flix | last post by:
I need some help to handle the Region property of my Form in the correct way. Usually when I create shaped forms in my programs, I modify the Form.Region property, making it include only a part of...
2
by: Publicjoe | last post by:
I now understand the issue. The code Bob posted has the same issue. It appears that when you have the screen resolution set to 32-bit, then the transparencykey does not work. Thanks guys for...
4
by: Failure | last post by:
As far as I know, Groupboxes only come in one shape, a rectangle. But on one of my forms, it would be best if I could have a groupbox that's shaped like this: _______ | | _________|...
3
by: Arturo Toledo | last post by:
Ok.. I need to create a button. Not a normal one. I need one that has a STAR shape. I need it to be yellow and with a face. When I rollover this button I need the face to smile and to have...
0
by: dr | last post by:
C# Irregular shaped user controls. How to make usercontrol have transparency key for its background image? I want to have irregular shaped user controls on my form. like a funny shaped button....
3
vdraceil
by: vdraceil | last post by:
Hi everyone,i just wanted to know whether it is possible to hav different shaped command buttons in VB6.0?-i mean using oval shaped buttons,star shaped buttons,something like that in my forms just to...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.