Results 1 to 26 of 26

Thread: The (Container) User Control: Child supports transparency *Resolved*

Threaded View

  1. #3

    Thread Starter
    Lively Member
    Join Date
    Aug 2003
    Location
    When?!?!
    Posts
    108
    No, I created a gradient User Control with this code.
    VB Code:
    1. Private Sub Gradiate(ByVal color1 As Color, ByVal color2 As Color, ByVal mode As System.Drawing.Drawing2D.LinearGradientMode)
    2.         Dim ghcs As Graphics = Me.CreateGraphics
    3.         Dim brush As New System.Drawing.Drawing2D.LinearGradientBrush(New RectangleF(0, 0, Me.Width, Me.Height), color1, color2, mode)
    4.         ghcs.FillRectangle(brush, New RectangleF(0, 0, Me.Width, Me.Height))
    5.         ghcs.Dispose()
    6.     End Sub
    My User Control's soul purpose is to allow alphablending into objects. Some alphablending code would bee down there:
    VB Code:
    1. Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    2.         Label1.BackColor = Color.FromArgb(100, 255, 255, 255)
    3.     End Sub
    Now my whole point here is to let the child control alphablend with my User Control's gradient. What do I end up with? I end up alphablending with my User Control's BackColor. I want it to alphablend with my gradient. Is there any way to do this?
    Last edited by Danny J; Oct 18th, 2003 at 05:06 PM.
    DannyJoumaa
    Advanced VB6 Programmer
    Intermediate-Advanced VB .NET Programmer
    Intermediate C# Programmer
    Intermediate Win32 Developer
    Beginner Mac OS X Developer
    Contact: [email protected]

    Favorite Sayings:
    "Every time you open your mouth, you prove your an idiot."
    "God is a programmer. Satan is a bug. Life is debugging."

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width