VB.Net Window Setup (Facet Class)
Public Class Facet
Dim screen_rect As Rectangle
Public CLICK_OCCURRED As Boolean = False
Public Sub formFeatures(sender As Object)
screen_rect = Screen.PrimaryScreen.Bounds
sender.SetDesktopBounds(0, 0, screen_rect.Width, screen_rect.Height)
sender.Text = "useOfMaths.com"
sender.BackColor = System.Drawing.Color.LightGray
Dim path = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().CodeBase)
path = New Uri(path).LocalPath
Try
sender.Icon = New Icon(path & "\useOfMaths.ico")
Catch ex As System.IO.FileNotFoundException
End Try
Dim response_btn As New Button()
response_btn.BackColor = System.Drawing.Color.Magenta
response_btn.ForeColor = System.Drawing.Color.Blue
response_btn.Name = "response_btn"
response_btn.SetBounds(CInt(Math.Round(screen_rect.Width / 2)) - 50, 5, 100, 40)
response_btn.Text = "Move"
sender.Controls.Add(response_btn)
AddHandler response_btn.Click, AddressOf response_btn_Click
End Sub
Public Sub decorateButtonArea(sender As Object, e As PaintEventArgs)
Dim pencil As New System.Drawing.Pen(System.Drawing.Color.Black)
pencil.DashStyle = Drawing2D.DashStyle.DashDot
pencil.Width = 5
e.Graphics.DrawLine(pencil, 0, 50, sender.Width, 50)
pencil.Dispose()
Dim paint_brush As New System.Drawing.SolidBrush(System.Drawing.Color.Pink)
e.Graphics.FillRectangle(paint_brush, 0, 0, sender.Width, 50)
paint_brush.Dispose()
End Sub
Public Sub response_btn_Click(sender As Object, e As EventArgs)
CLICK_OCCURRED = True
sender.Refresh()
End Sub
End Class