Click here to Skip to main content
15,887,386 members
Home / Discussions / C#
   

C#

 
QuestionGeneral programming ideea, just so I go the right way Pin
sodevrom27-Nov-08 11:15
sodevrom27-Nov-08 11:15 
AnswerRe: General programming ideea, just so I go the right way Pin
User 665827-Nov-08 11:39
User 665827-Nov-08 11:39 
GeneralRe: General programming ideea, just so I go the right way Pin
sodevrom27-Nov-08 11:45
sodevrom27-Nov-08 11:45 
GeneralRe: General programming ideea, just so I go the right way Pin
User 665827-Nov-08 14:01
User 665827-Nov-08 14:01 
QuestionC# WinForms DataBinding? Pin
wbjohnson27-Nov-08 10:25
wbjohnson27-Nov-08 10:25 
AnswerRe: C# WinForms DataBinding? Pin
nelsonpaixao30-Nov-08 4:44
nelsonpaixao30-Nov-08 4:44 
GeneralRe: C# WinForms DataBinding? Pin
wbjohnson30-Nov-08 5:33
wbjohnson30-Nov-08 5:33 
QuestionTransparency, or alternative, in non-client area. Pin
Chris Copeland27-Nov-08 10:05
mveChris Copeland27-Nov-08 10:05 
Hey.

After googling for an adament amount of time, I found that you can't (apparently) apply transparency to a non-client region of a control.
So the alternative is to have the control inherit the BackColor of the parent container.

The problem is, my Parent control has a gradient background that's fully customizable. So I cannot set a specific BackColor for the control to paint.

Each control has the functions DrawToBitmap() which is usable, but i'm really struggling having it apply to my control.
I'm trying to find the specific background that is located at the position of the non-client region for my control, but it's simply not working.

Currently i'm using:

Graphics Root = Parent.CreateGraphics();
 Bitmap RootImage = new Bitmap(e.ClipRectangle.Width, e.ClipRectangle.Height);
 Parent.DrawToBitmap(
     RootImage,
     new Rectangle(
         this.Left,
         this.Top,
         e.ClipRectangle.Width + this.Left,
         CaptionOffset
         ));

 e.Graphics.DrawImage(RootImage, new Point(-this.Left, -this.Top));


And this code is as close as I could get it to work. The e.ClipRectangle is the Rectangle within the actual control itself (ie, x will simply always be 0). I'm assuming that by passing this.Left into the Rectangle within the DrawToBitmap function will grab the graphics from the left of the parent control, but it's not working. Not only is the Bitmap RootImage smaller than the actual region I want (by about 8px in width), but when I try to paint it to a second control within the parent container, it doesn't draw a background at all.

Here's an image of the problem[^]. The first panel only displays a part of the background, and the second doesn't display any at all.

If anyone can help or provide more information on the DrawToBitmap function, it'd be much appreciated.

Thanks!
AnswerRe: Transparency, or alternative, in non-client area. Pin
leppie27-Nov-08 22:02
leppie27-Nov-08 22:02 
QuestionI do not undertand arraylist or list Pin
netJP12L27-Nov-08 8:24
netJP12L27-Nov-08 8:24 
AnswerRe: I do not undertand arraylist or list Pin
User 665827-Nov-08 9:08
User 665827-Nov-08 9:08 
GeneralRe: I do not undertand arraylist or list Pin
Luc Pattyn27-Nov-08 10:12
sitebuilderLuc Pattyn27-Nov-08 10:12 
Questionhow to use variable form other class? C# Pin
ping_jacob27-Nov-08 7:30
ping_jacob27-Nov-08 7:30 
AnswerRe: how to use variable form other class? C# [modified] Pin
Kristian Sixhøj27-Nov-08 7:40
Kristian Sixhøj27-Nov-08 7:40 
AnswerRe: how to use variable form other class? C# Pin
Christian Graus27-Nov-08 10:11
protectorChristian Graus27-Nov-08 10:11 
AnswerRe: how to use variable form other class? C# [modified] Pin
Pedram Behroozi27-Nov-08 10:14
Pedram Behroozi27-Nov-08 10:14 
GeneralRe: how to use variable form other class? C# Pin
ping_jacob29-Nov-08 5:24
ping_jacob29-Nov-08 5:24 
GeneralRe: how to use variable form other class? C# Pin
Pedram Behroozi29-Nov-08 5:47
Pedram Behroozi29-Nov-08 5:47 
AnswerRe: how to use variable form other class? C# Pin
SelvaSR11-Dec-08 23:09
SelvaSR11-Dec-08 23:09 
QuestionHow to learn C# & .NET framework when I know C++ Pin
just.an.imbecile227-Nov-08 5:34
just.an.imbecile227-Nov-08 5:34 
AnswerRe: How to learn C# & .NET framework when I know C++ Pin
EliottA27-Nov-08 5:43
EliottA27-Nov-08 5:43 
AnswerRe: How to learn C# & .NET framework when I know C++ Pin
Thomas Weller27-Nov-08 5:51
Thomas Weller27-Nov-08 5:51 
JokeRe: How to learn C# & .NET framework when I know C++ Pin
Tom Deketelaere27-Nov-08 21:54
professionalTom Deketelaere27-Nov-08 21:54 
GeneralRe: How to learn C# & .NET framework when I know C++ Pin
Thomas Weller27-Nov-08 22:14
Thomas Weller27-Nov-08 22:14 
JokeRe: How to learn C# & .NET framework when I know C++ Pin
Tom Deketelaere27-Nov-08 22:25
professionalTom Deketelaere27-Nov-08 22:25 

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.