Click here to Skip to main content
15,887,331 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: For next loop with DB GRID Pin
jlawren76-Dec-04 11:29
jlawren76-Dec-04 11:29 
GeneralRe: For next loop with DB GRID Pin
Paps27-Dec-04 3:05
Paps27-Dec-04 3:05 
GeneralTab control ... Pin
AbuFahed6-Dec-04 1:22
AbuFahed6-Dec-04 1:22 
GeneralRe: Tab control ... Pin
Pablo.ar7-Dec-04 0:45
Pablo.ar7-Dec-04 0:45 
QuestionHow do you create a transparent label on a gradient colored form? Pin
David M J6-Dec-04 0:24
David M J6-Dec-04 0:24 
AnswerRe: How do you create a transparent label on a gradient colored form? Pin
The Man from U.N.C.L.E.8-Dec-04 3:31
The Man from U.N.C.L.E.8-Dec-04 3:31 
GeneralRe: How do you create a transparent label on a gradient colored form? Pin
David M J9-Dec-04 6:59
David M J9-Dec-04 6:59 
GeneralRe: How do you create a transparent label on a gradient colored form? Pin
The Man from U.N.C.L.E.10-Dec-04 0:57
The Man from U.N.C.L.E.10-Dec-04 0:57 
Odd...
I have included the entire code of my test form here. When I run it I get the gradient applied uniformly even behind the label.

Imports System.Reflection

Public Class Form1
    Inherits System.Windows.Forms.Form

#Region " Windows Form Designer generated code "

    Public Sub New()
        MyBase.New()

        'This call is required by the Windows Form Designer.
        InitializeComponent()

        'Add any initialization after the InitializeComponent() call

    End Sub

    'Form overrides dispose to clean up the component list.
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing Then
            If Not (components Is Nothing) Then
                components.Dispose()
            End If
        End If
        MyBase.Dispose(disposing)
    End Sub

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.  
    'Do not modify it using the code editor.
    Friend WithEvents Label1 As CustomLabel
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.Label1 = New CustomLabel
        Me.SuspendLayout()
        '
        'Label1
        '
        Me.Label1.Location = New System.Drawing.Point(136, 128)
        Me.Label1.Name = "Label1"
        Me.Label1.TabIndex = 0
        Me.Label1.Text = "Label1"
        '
        'Form1
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
        Me.ClientSize = New System.Drawing.Size(292, 266)
        Me.Controls.Add(Me.Label1)
        Me.Name = "Form1"
        Me.Text = "Form1"
        Me.ResumeLayout(False)

    End Sub

#End Region

    Public Shared Sub main()
        Application.EnableVisualStyles()
        Application.DoEvents()
        Application.Run(New Form1)
    End Sub

    Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
        MyBase.OnPaint(e)

        Dim brush As New Drawing2D.LinearGradientBrush(Me.ClientRectangle, Color.Azure, Color.DarkGreen, Drawing2D.LinearGradientMode.BackwardDiagonal)
        e.Graphics.FillRectangle(brush, Me.ClientRectangle)
        brush.Dispose()

    End Sub

End Class

Public Class CustomLabel : Inherits Label

    Public Sub New()
        MyBase.New()

        Me.SetStyle(ControlStyles.SupportsTransparentBackColor, True)
        Me.BackColor = Color.Transparent
    End Sub

End Class


If you have knowledge, let others light their candles at it.
Margaret Fuller (1810 - 1850)
GeneralRe: How do you create a transparent label on a gradient colored form? Pin
David M J10-Dec-04 22:36
David M J10-Dec-04 22:36 
GeneralCrystal reports"Numbers to words" Pin
anom2m6-Dec-04 0:19
anom2m6-Dec-04 0:19 
GeneralUrgent: Killing Threads Pin
cwayman5-Dec-04 23:02
cwayman5-Dec-04 23:02 
GeneralHook Messages or ... Pin
rdges5-Dec-04 21:50
rdges5-Dec-04 21:50 
GeneralRe: Hook Messages or ... Pin
Dave Kreskowiak6-Dec-04 4:07
mveDave Kreskowiak6-Dec-04 4:07 
GeneralProgress Bar Pin
nitin_ion5-Dec-04 18:59
nitin_ion5-Dec-04 18:59 
GeneralRe: Progress Bar Pin
Tom John7-Dec-04 5:37
Tom John7-Dec-04 5:37 
GeneralDifference between DHTML and Web Controls Pin
iamalik5-Dec-04 18:27
professionaliamalik5-Dec-04 18:27 
GeneralRe: Difference between DHTML and Web Controls Pin
Dave Kreskowiak6-Dec-04 4:01
mveDave Kreskowiak6-Dec-04 4:01 
GeneralDisplay report base on value from list view Pin
Mekong River5-Dec-04 15:19
Mekong River5-Dec-04 15:19 
GeneralHelp please.... Pin
simiyah5-Dec-04 10:26
simiyah5-Dec-04 10:26 
GeneralRe: Help please.... Pin
Pablo.ar5-Dec-04 15:25
Pablo.ar5-Dec-04 15:25 
GeneralRe: Help please.... Pin
Pablo.ar7-Dec-04 0:36
Pablo.ar7-Dec-04 0:36 
GeneralProtecting executable files Pin
matrixcine5-Dec-04 7:28
matrixcine5-Dec-04 7:28 
GeneralRe: Protecting executable files Pin
Dave Kreskowiak6-Dec-04 3:41
mveDave Kreskowiak6-Dec-04 3:41 
GeneralRunning executables from VB Pin
Programmer_Chris5-Dec-04 5:29
Programmer_Chris5-Dec-04 5:29 
GeneralRe: Running executables from VB Pin
jlawren75-Dec-04 6:23
jlawren75-Dec-04 6:23 

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.