Click here to Skip to main content
15,902,777 members
Home / Discussions / C#
   

C#

 
GeneralRe: Tooltip on disabled controls? Pin
mike montagne27-Feb-07 20:12
mike montagne27-Feb-07 20:12 
GeneralRe: Tooltip on disabled controls? Pin
Nilesh K.27-Feb-07 20:22
Nilesh K.27-Feb-07 20:22 
GeneralRe: Tooltip on disabled controls? Pin
mike montagne28-Feb-07 5:41
mike montagne28-Feb-07 5:41 
GeneralRe: Tooltip on disabled controls? Pin
Nilesh K.28-Feb-07 16:01
Nilesh K.28-Feb-07 16:01 
GeneralRe: Tooltip on disabled controls? Pin
mike montagne28-Feb-07 17:53
mike montagne28-Feb-07 17:53 
QuestionCreating Help file (chm ) Pin
Praveen_S27-Feb-07 17:16
Praveen_S27-Feb-07 17:16 
AnswerRe: Creating Help file (chm ) Pin
Vasudevan Deepak Kumar27-Feb-07 17:29
Vasudevan Deepak Kumar27-Feb-07 17:29 
QuestionUserControl Pin
fjlv200527-Feb-07 16:44
fjlv200527-Feb-07 16:44 
Good day,

I have a form, i've set the BackColor to Black and also the transparency to Black.
then on the form a UserControl which has a gradient backcolor.

Inside the UserControl i've put two basic controls(Label1 and Button1).
I've set the BackColor of Label1 and Button1 to Transparent. What happened is
that the Label1 and Button1 transparency goes through the form itself. See Link Below:

http://www.geocities.com/fritzjeran/Sample.JPG

What I really wanted is that when i set the BackColor of the Label1 and Button1
to transparent, I goes through ONLY up to the UserControl (i.e what should appear
is the gradient color of usercontrol on the area that is overlapped by label1 and Button1).

How should I fix this?Cry | :((

Here is the code of my Usercontrol:

public partial class BaseControl : UserControl
{
    public BaseControl()
    {
        InitializeComponent();
        SetStyle(ControlStyles.DoubleBuffer | ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint | ControlStyles.EnableNotifyMessage, true);
    }
    protected override void OnPaint(PaintEventArgs e)
    {
        if (this.BackgroundImage == null)
        {
            Rectangle rect = new Rectangle(0, 0, Width, Height);
            LinearGradientBrush b = new LinearGradientBrush(rect, Color.White, Color.Blue, 90);
            GraphicsPath path = GraphicsPathUtility.GetRoundRectPath(rect, 10);
            e.Graphics.FillPath(b, path);
        }
        base.OnPaint(e);
     }
}

#region Utility Classes
public class GraphicsPathUtility
{
    private GraphicsPathUtility()
    {
    }
    public static GraphicsPath GetRoundRectPath(RectangleF rect, float radius)
    {
        return GetRoundRectPath(rect.X, rect.Y, rect.Width, rect.Height, radius);
    }
    public static GraphicsPath GetRoundRectPath(float X, float Y, float width, float height, float radius)
    {
        GraphicsPath gp = new GraphicsPath();
        gp.AddLine(X + radius, Y, X + width - (radius * 2), Y); //
        gp.AddArc(X + width - (radius * 2), Y, radius * 2, radius * 2, 270, 90);//
        gp.AddLine(X + width, Y + radius, X + width, Y + height - (radius * 2));
        gp.AddArc(X + width - (radius * 2), Y + height - (radius * 2), radius * 2, radius * 2, 0, 90);
        gp.AddLine(X + width - (radius * 2), Y + height, X + radius, Y + height);
        gp.AddArc(X, Y + height - (radius * 2), radius * 2, radius * 2, 90, 90);
        gp.AddLine(X, Y + height - (radius * 2), X, Y + radius);
        gp.AddArc(X, Y, radius * 2, radius * 2, 180, 90);
        gp.CloseFigure();
        return gp;
    }
}
#endregion



I would like also to acknowledge those who previosly help me. Thanks.
QuestionConverting strings to other data types Pin
Leo Smith27-Feb-07 14:10
Leo Smith27-Feb-07 14:10 
AnswerRe: Converting strings to other data types Pin
Christian Graus27-Feb-07 15:13
protectorChristian Graus27-Feb-07 15:13 
GeneralRe: Converting strings to other data types Pin
Leo Smith27-Feb-07 15:41
Leo Smith27-Feb-07 15:41 
QuestionWindows Status Bar / System Tray Pin
Rabbit1727-Feb-07 13:55
Rabbit1727-Feb-07 13:55 
QuestionWindows Service and Directory.Exists() Pin
Christopher Stratmann27-Feb-07 13:54
Christopher Stratmann27-Feb-07 13:54 
AnswerRe: Windows Service and Directory.Exists() Pin
Vasudevan Deepak Kumar27-Feb-07 17:32
Vasudevan Deepak Kumar27-Feb-07 17:32 
GeneralRe: Windows Service and Directory.Exists() Pin
Christopher Stratmann28-Feb-07 0:47
Christopher Stratmann28-Feb-07 0:47 
AnswerRe: enumerator woes Pin
mike montagne27-Feb-07 14:04
mike montagne27-Feb-07 14:04 
GeneralRe: enumerator woes Pin
Glen Harvy27-Feb-07 14:22
Glen Harvy27-Feb-07 14:22 
GeneralRe: enumerator woes Pin
mike montagne27-Feb-07 14:29
mike montagne27-Feb-07 14:29 
GeneralRe: enumerator woes Pin
Glen Harvy27-Feb-07 15:16
Glen Harvy27-Feb-07 15:16 
QuestionSimple Open File With... Question Pin
cmarcus27-Feb-07 13:14
cmarcus27-Feb-07 13:14 
AnswerRe: Simple Open File With... Question Pin
Vasudevan Deepak Kumar27-Feb-07 17:33
Vasudevan Deepak Kumar27-Feb-07 17:33 
AnswerRe: Simple Open File With... Question Pin
blackjack215027-Feb-07 23:13
blackjack215027-Feb-07 23:13 
QuestionC# Question with Generics Pin
malharone27-Feb-07 10:56
malharone27-Feb-07 10:56 
AnswerRe: C# Question with Generics Pin
Ssswamii27-Feb-07 12:58
Ssswamii27-Feb-07 12:58 
GeneralRe: C# Question with Generics Pin
malharone27-Feb-07 13:02
malharone27-Feb-07 13:02 

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.