etched line look quickly

  • Thread starter Thread starter Brian Henry
  • Start date Start date
B

Brian Henry

Is there a quick way to produce an etched line look that microsoft uses to
split up sections (similar to the bottom line of a group box) with out
actually using the GDI commands to draw it as line and another line? i
thought i saw a way in the past but cant find it now... thanks
 
* "Brian Henry said:
Is there a quick way to produce an etched line look that microsoft uses to
split up sections (similar to the bottom line of a group box) with out
actually using the GDI commands to draw it as line and another line? i
thought i saw a way in the past but cant find it now... thanks

Are you looking for something similar to 'RoundRect' in GDI API?

I never used it, but have a look at 'System.Drawing.Drawing2D.LineJoin'.
 
actually this is more like what i was trying to do :)


Imports System.Windows.Forms

Imports System.Drawing

Public Class etchedLine

Inherits System.Windows.Forms.UserControl

#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

'UserControl 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.

<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()

'

'etchedLine

'

Me.Name = "etchedLine"

Me.Size = New System.Drawing.Size(328, 160)

End Sub

#End Region

Private Sub etchedLine_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

End Sub

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

Dim g As Graphics = e.Graphics

ControlPaint.DrawBorder3D(g, 0, 0, Me.Width, 2, Border3DStyle.Etched,
Border3DSide.Bottom)

Me.Height = 2



End Sub

End Class
 
Hi Brian

The trick of using a label with BorderStyle = Fixed3D and Height = 2 works
in VB.NET.

HTH

Charles
 
* "Brian Henry said:
actually this is more like what i was trying to do :)

Thank you, I was not sure if I understood you. Now I know that I
didn't.

:-)
 
I like the way I found better :) the controlpaint class has a method for
doing it, but thanks!
 
Back
Top