Click here to Skip to main content
15,905,233 members
Home / Discussions / C#
   

C#

 
GeneralDetecting when a MdiList Child MenuItem is selected Pin
kyledunn14-Feb-02 5:32
kyledunn14-Feb-02 5:32 
GeneralRe: Detecting when a MdiList Child MenuItem is selected Pin
Torsten Mauz11-Mar-02 3:03
Torsten Mauz11-Mar-02 3:03 
GeneralOpening New Form Pin
Gavin_Mannion14-Feb-02 4:55
Gavin_Mannion14-Feb-02 4:55 
GeneralRe: Opening New Form Pin
14-Feb-02 7:33
suss14-Feb-02 7:33 
GeneralRe: Opening New Form Pin
Gavin_Mannion14-Feb-02 23:15
Gavin_Mannion14-Feb-02 23:15 
GeneralRe: Opening New Form Pin
Andres Manggini20-Feb-02 15:38
Andres Manggini20-Feb-02 15:38 
GeneralPorting MFC to UNIX Pin
14-Feb-02 0:32
suss14-Feb-02 0:32 
GeneralRe: Porting MFC to UNIX Pin
Christopher Lord17-Feb-02 14:57
Christopher Lord17-Feb-02 14:57 
GeneralAssociating shortcut key with a button Pin
paulb13-Feb-02 15:59
paulb13-Feb-02 15:59 
GeneralProgrammatically pressing F1 key on keyboard Pin
kyledunn13-Feb-02 10:12
kyledunn13-Feb-02 10:12 
GeneralRe: Programmatically pressing F1 key on keyboard Pin
15-Feb-02 9:44
suss15-Feb-02 9:44 
QuestionSending multiple items to the clipboard? Pin
13-Feb-02 8:25
suss13-Feb-02 8:25 
AnswerRe: Sending multiple items to the clipboard? Pin
James T. Johnson13-Feb-02 12:22
James T. Johnson13-Feb-02 12:22 
GeneralRe: Sending multiple items to the clipboard? Pin
14-Feb-02 4:42
suss14-Feb-02 4:42 
GeneralPorting MFC Container into C# Pin
13-Feb-02 7:58
suss13-Feb-02 7:58 
Generaldrawing an icon on a form Pin
Senkwe Chanda13-Feb-02 2:34
Senkwe Chanda13-Feb-02 2:34 
GeneralRe: drawing an icon on a form Pin
Peter Stephens13-Feb-02 10:30
Peter Stephens13-Feb-02 10:30 
GeneralRe: drawing an icon on a form Pin
Senkwe Chanda13-Feb-02 19:15
Senkwe Chanda13-Feb-02 19:15 
GeneralAuthenticating request from another machine Pin
bcooper13-Feb-02 2:29
bcooper13-Feb-02 2:29 
GeneralTransparent backgrounds for controls Pin
Profox Jase13-Feb-02 2:11
Profox Jase13-Feb-02 2:11 
GeneralRe: Transparent backgrounds for controls Pin
Senkwe Chanda13-Feb-02 3:16
Senkwe Chanda13-Feb-02 3:16 
GeneralRe: Transparent backgrounds for controls Pin
Profox Jase13-Feb-02 5:38
Profox Jase13-Feb-02 5:38 
Hi Senkwe,

Thanks for taking the time to help me. I have tried your idea but nfortunately your suggestion does not solve the problem.

My polygon represents an irregular shape - actually, an asteroid.

The foreground is, say, red - yes, a red asteroid (and why not?).
The background which c# paints it on is the same colour as the form (grey).
It is possible to change the background colour to black, green etc etc. When you do this, you get a red asteroid in a black (or whatever) rectangle.

When two asteroids overlap slightly the rectangle from one blocks out (is on top of) the other asteroid - this is my problem. All asteroid need to be drawn on a transparent rectangle so that their canvasses do not obscure each other.

If you look at control.settype, it seems there may be a way to make the background colour transparent, in fact I have managed this, however, the asteroid is redrawn very slowly.... here is some of the code from the constructor of asteroid:control

public asteroid(int startX, int startY, int incX, int incY, Form theForm)
{
this.SetStyle(ControlStyles.UserPaint, true);
this.SetStyle(ControlStyles.SupportsTransparentBackColor, true);
this.backgroundColor = Color.FromArgb(1,Color.Gray);
...


I think I will tidy up my code and paste here for people to read. As an additional problem, when I am performing collision testing, I have a peculiar problem that seems to be inconsistent. When I create a rectangular region from my asteroid control, I can use region.isVisible(point) to test whether point is included in the region. This works. When I create an asteroid shaped region (instead of a rectangular shape), the call to region.isVisible(point) always seems to return false. Perhaps I am misunderstanding the region concept. Any ideas?





Jase

jason.king@profox.co.uk
Feel the love at www.profox.co.uk
GeneralRe: Transparent backgrounds for controls Pin
James T. Johnson13-Feb-02 8:11
James T. Johnson13-Feb-02 8:11 
GeneralRe: Transparent backgrounds for controls Pin
Profox Jase17-Feb-02 0:46
Profox Jase17-Feb-02 0:46 
GeneralC# and .NET books Pin
Oyvind Bratland13-Feb-02 0:42
Oyvind Bratland13-Feb-02 0:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.