Public feed #892564

Mine

public text v1 · immutable
Raw Edit
·published 2008-02-05 15:16 UTC
rendered paste body
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 btnHappy As System.Windows.Forms.Button
    Friend WithEvents btnSad As System.Windows.Forms.Button
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.btnHappy = New System.Windows.Forms.Button
        Me.btnSad = New System.Windows.Forms.Button
        Me.SuspendLayout()
        '
        'btnHappy
        '
        Me.btnHappy.Location = New System.Drawing.Point(16, 24)
        Me.btnHappy.Name = "btnHappy"
        Me.btnHappy.Size = New System.Drawing.Size(96, 24)
        Me.btnHappy.TabIndex = 0
        Me.btnHappy.Text = "Happy"
        '
        'btnSad
        '
        Me.btnSad.Location = New System.Drawing.Point(176, 24)
        Me.btnSad.Name = "btnSad"
        Me.btnSad.Size = New System.Drawing.Size(96, 24)
        Me.btnSad.TabIndex = 1
        Me.btnSad.Text = "Sad"
        '
        'Form1
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
        Me.ClientSize = New System.Drawing.Size(292, 266)
        Me.Controls.Add(Me.btnSad)
        Me.Controls.Add(Me.btnHappy)
        Me.Name = "Form1"
        Me.Text = "Form1"
        Me.ResumeLayout(False)

    End Sub

#End Region


    Private Sub btnHappy_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnHappy.Click
        Dim FormSurface As Graphics = Me.CreateGraphics
        FormSurface.Clear(Me.BackColor)
        Dim Smiley As New SolidBrush(Color.Yellow)
        FormSurface.FillPie(Smiley, 50, 60, 170, 170, 0, 360)
        Dim Eye_Left As New SolidBrush(Color.BlueViolet)
        FormSurface.FillPie(Eye_Left, 80, 90, 20, 20, 0, 360)
        Dim Eye_right As New SolidBrush(Color.BlueViolet)
        FormSurface.FillPie(Eye_right, 170, 90, 20, 20, 0, 360)
        Dim Mouth As New SolidBrush(Color.Red)
        FormSurface.FillPie(Mouth, 90, 120, 100, 100, 0, 180)
        Dim Nose As New SolidBrush(Color.WhiteSmoke)
        FormSurface.FillPie(Nose, 130, 120, 20, 20, 0, 360)
    End Sub

    Private Sub btnSad_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSad.Click
        Dim FormSurface As Graphics = Me.CreateGraphics
        FormSurface.Clear(Me.BackColor)
        Dim Smiley As New SolidBrush(Color.Yellow)
        FormSurface.FillPie(Smiley, 50, 60, 170, 170, 0, 360)
        Dim Eye_Left As New SolidBrush(Color.BlueViolet)
        FormSurface.FillPie(Eye_Left, 80, 90, 20, 20, 0, 360)
        Dim Eye_right As New SolidBrush(Color.BlueViolet)
        FormSurface.FillPie(Eye_right, 170, 90, 20, 20, 0, 360)
        Dim Mouth As New SolidBrush(Color.Red)
        FormSurface.FillPie(Mouth, 90, 160, 100, 100, 180, 180)
        Dim Nose As New SolidBrush(Color.WhiteSmoke)
        FormSurface.FillPie(Nose, 130, 120, 20, 20, 0, 360)

    End Sub
End Class