Imports System
Imports System.Windows.Forms
Imports System.Drawing.Text
Imports System.Drawing
Public Class MainClass
Shared Sub Main(ByVal args As String())
Dim myform As Form = New Form1()
Application.Run(myform)
End Sub
End Class
Public Class Form1
Private Sub Form1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint
DrawingHatchStyles(e.Graphics)
End Sub
Private Sub Form1_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Resize
DrawingHatchStyles(Me.CreateGraphics)
End Sub
Private Sub DrawingHatchStyles(ByVal gr As Graphics)
Dim x As Integer = 10
Dim y As Integer = 20
gr.Clear(Me.BackColor)
DrawingHatchStyle(gr, x, y, Drawing2D.HatchStyle.BackwardDiagonal)
DrawingHatchStyle(gr, x, y, Drawing2D.HatchStyle.Cross)
DrawingHatchStyle(gr, x, y, Drawing2D.HatchStyle.DarkDownwardDiagonal)
DrawingHatchStyle(gr, x, y, Drawing2D.HatchStyle.DarkHorizontal)
DrawingHatchStyle(gr, x, y, Drawing2D.HatchStyle.DarkUpwardDiagonal)
DrawingHatchStyle(gr, x, y, Drawing2D.HatchStyle.DarkVertical)
DrawingHatchStyle(gr, x, y, Drawing2D.HatchStyle.DashedDownwardDiagonal)
DrawingHatchStyle(gr, x, y, Drawing2D.HatchStyle.DashedHorizontal)
DrawingHatchStyle(gr, x, y, Drawing2D.HatchStyle.DashedUpwardDiagonal)
DrawingHatchStyle(gr, x, y, Drawing2D.HatchStyle.DashedVertical)
DrawingHatchStyle(gr, x, y, Drawing2D.HatchStyle.DiagonalBrick)
DrawingHatchStyle(gr, x, y, Drawing2D.HatchStyle.DiagonalCross)
DrawingHatchStyle(gr, x, y, Drawing2D.HatchStyle.Divot)
DrawingHatchStyle(gr, x, y, Drawing2D.HatchStyle.DottedDiamond)
DrawingHatchStyle(gr, x, y, Drawing2D.HatchStyle.DottedGrid)
DrawingHatchStyle(gr, x, y, Drawing2D.HatchStyle.ForwardDiagonal)
DrawingHatchStyle(gr, x, y, Drawing2D.HatchStyle.Horizontal)
DrawingHatchStyle(gr, x, y, Drawing2D.HatchStyle.HorizontalBrick)
DrawingHatchStyle(gr, x, y, Drawing2D.HatchStyle.LargeCheckerBoard)
DrawingHatchStyle(gr, x, y, Drawing2D.HatchStyle.LargeConfetti)
DrawingHatchStyle(gr, x, y, Drawing2D.HatchStyle.LargeGrid)
DrawingHatchStyle(gr, x, y, Drawing2D.HatchStyle.LightDownwardDiagonal)
DrawingHatchStyle(gr, x, y, Drawing2D.HatchStyle.LightHorizontal)
DrawingHatchStyle(gr, x, y, Drawing2D.HatchStyle.LightUpwardDiagonal)
DrawingHatchStyle(gr, x, y, Drawing2D.HatchStyle.LightVertical)
DrawingHatchStyle(gr, x, y, Drawing2D.HatchStyle.NarrowHorizontal)
DrawingHatchStyle(gr, x, y, Drawing2D.HatchStyle.NarrowVertical)
DrawingHatchStyle(gr, x, y, Drawing2D.HatchStyle.OutlinedDiamond)
DrawingHatchStyle(gr, x, y, Drawing2D.HatchStyle.Percent05)
DrawingHatchStyle(gr, x, y, Drawing2D.HatchStyle.Percent10)
DrawingHatchStyle(gr, x, y, Drawing2D.HatchStyle.Percent20)
DrawingHatchStyle(gr, x, y, Drawing2D.HatchStyle.Percent25)
DrawingHatchStyle(gr, x, y, Drawing2D.HatchStyle.Percent30)
DrawingHatchStyle(gr, x, y, Drawing2D.HatchStyle.Percent40)
DrawingHatchStyle(gr, x, y, Drawing2D.HatchStyle.Percent50)
DrawingHatchStyle(gr, x, y, Drawing2D.HatchStyle.Percent60)
DrawingHatchStyle(gr, x, y, Drawing2D.HatchStyle.Percent70)
DrawingHatchStyle(gr, x, y, Drawing2D.HatchStyle.Percent75)
DrawingHatchStyle(gr, x, y, Drawing2D.HatchStyle.Percent80)
DrawingHatchStyle(gr, x, y, Drawing2D.HatchStyle.Percent90)
DrawingHatchStyle(gr, x, y, Drawing2D.HatchStyle.Plaid)
DrawingHatchStyle(gr, x, y, Drawing2D.HatchStyle.Shingle)
DrawingHatchStyle(gr, x, y, Drawing2D.HatchStyle.SmallCheckerBoard)
DrawingHatchStyle(gr, x, y, Drawing2D.HatchStyle.SmallConfetti)
DrawingHatchStyle(gr, x, y, Drawing2D.HatchStyle.SmallGrid)
DrawingHatchStyle(gr, x, y, Drawing2D.HatchStyle.SolidDiamond)
DrawingHatchStyle(gr, x, y, Drawing2D.HatchStyle.Sphere)
DrawingHatchStyle(gr, x, y, Drawing2D.HatchStyle.Trellis)
DrawingHatchStyle(gr, x, y, Drawing2D.HatchStyle.Vertical)
DrawingHatchStyle(gr, x, y, Drawing2D.HatchStyle.Wave)
DrawingHatchStyle(gr, x, y, Drawing2D.HatchStyle.Weave)
DrawingHatchStyle(gr, x, y, Drawing2D.HatchStyle.WideDownwardDiagonal)
DrawingHatchStyle(gr, x, y, Drawing2D.HatchStyle.WideUpwardDiagonal)
DrawingHatchStyle(gr, x, y, Drawing2D.HatchStyle.ZigZag)
End Sub
Private Sub DrawingHatchStyle(ByVal gr As Graphics, ByRef x As Integer, ByRef y As Integer, ByVal hatch_style As Drawing2D.HatchStyle)
gr.DrawString(hatch_style.ToString, Me.Font, Brushes.Black, x, y)
Dim the_brush As New Drawing2D.HatchBrush(hatch_style, Color.Black, Color.White)
gr.FillRectangle(the_brush, x, y + 15, 100, 20)
y += 50
If y + 50 > Me.ClientRectangle.Height Then
x += 150
y = 20
End If
End Sub
End Class
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Public Class Form1
Inherits System.Windows.Forms.Form
'Form overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
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()
Me.SuspendLayout()
'
'Form1
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(564, 209)
Me.Name = "Form1"
Me.Text = "Title"
Me.ResumeLayout(False)
End Sub
End Class
|