X2021/Wardrobe/GUI.vb

31 lines
807 B
VB.net

Imports XCCLibrary
Public Class GUI
Dim DrawBox As Panel
Dim boxX, boxY, boxW, boxH, boxMidX, boxMidY As Integer
Sub GUI_load() Handles MyBase.Load
DrawBox = DrawingPanel
AddHandler DrawBox.Paint, AddressOf DrawingPanel_Paint
get_drawboxParameters()
End Sub
Private Sub get_drawboxParameters()
boxX = DrawBox.Location.X
boxY = DrawBox.Location.Y
boxW = DrawBox.Size.Width
boxH = DrawBox.Size.Height
boxMidX = boxX + boxW / 2
boxMidY = boxY + boxH / 2
End Sub
Private Sub DrawingPanel_Paint(sender As Object, e As System.Windows.Forms.PaintEventArgs)
Dim pen As Pen = New Pen(Color.Red, 2)
e.Graphics.DrawLine(pen, boxMidX, boxMidY, boxMidX + 1, boxMidY + 1)
End Sub
End Class