...
Private Sub CommanSet(ByVal Btn As Button, ByVal Txt As String, ByVal Sz As _
Size, ByVal Lc As Point)
With Btn
.Size = Sz
.Text = Txt
.BackColor = Color.Transparent
.FlatAppearance.BorderSize = 0
.FlatStyle = FlatStyle.Standard
.Location = Lc
.Anchor = AnchorStyles.Bottom Or AnchorStyles.Left Or _
AnchorStyles.Right
.TextAlign = ContentAlignment.MiddleCenter
.Font = BFont
.Visible = True
End With
Frm.Controls.Add(Btn)
End Sub
Private Sub LblHeader_MouseDown(ByVal sender As Object, ByVal e As _
System.Windows.Forms.MouseEventArgs) Handles LblHeader.MouseDown
MLocation = e.Location
End Sub
Private Sub LblHeader_MouseMove(ByVal sender As Object, ByVal e As _
System.Windows.Forms.MouseEventArgs) Handles LblHeader.MouseMove
If String.Compare(Control.MouseButtons.ToString(), "Left") = 0 Then
Dim MSize As New Size(MLocation)
MSize.Width = e.X - MLocation.X
MSize.Height = e.Y - MLocation.Y
Frm.Location = Point.Add(Frm.Location, MSize)
End If
End Sub
Private Sub LblHeader_Paint(ByVal sender As System.Object, ByVal e As _
System.Windows.Forms.PaintEventArgs) Handles LblHeader.Paint
Dim MGraphics As Graphics = e.Graphics
Dim MPen As New Pen(Color.FromArgb(96, 155, 173), 1)
Dim Area As New Rectangle(0, 0, LblHeader.Width - 1, LblHeader.Height - _
1)
Dim LGradient As New LinearGradientBrush(Area, Color.FromArgb(166, 197, _
227), Color.FromArgb(245, 251, 251), _
LinearGradientMode.BackwardDiagonal)
MGraphics.FillRectangle(LGradient, Area)
MGraphics.DrawRectangle(MPen, Area)
Dim DrawFont As New Font("Tahoma", 10, FontStyle.Bold)
Dim DrawBrush As New SolidBrush(Color.Black)
Dim DrawPoint As New PointF(2.0F, 3.0F)
Dim DrawGradientBrush As New LinearGradientBrush(e.Graphics.ClipBounds, _
Color.White, _
Color.FromArgb(122, 158, 226), _
LinearGradientMode.ForwardDiagonal)
e.Graphics.DrawString(_HeaderTitle.ToString(), DrawFont, DrawBrush, _
DrawPoint)
End Sub
Private Sub FrmMessageBox_Paint(ByVal sender As System.Object, ByVal e As _
System.Windows.Forms.PaintEventArgs) Handles Frm.Paint
Dim MGraphics As Graphics = e.Graphics
Dim MPen As New Pen(Color.FromArgb(96, 155, 173), 1)
Dim Area As New Rectangle(0, 0, Frm.Width - 1, Frm.Height - 1)
Dim LGradient As New LinearGradientBrush(Area, Color.FromArgb(166, 197, _
227), Color.FromArgb(245, 251, 251), _
LinearGradientMode.BackwardDiagonal)
MGraphics.FillRectangle(LGradient, Area)
MGraphics.DrawRectangle(MPen, Area)
End Sub
Private Sub CmdOk_Click(ByVal sender As Object, ByVal e As _
System.EventArgs) Handles CmdOk.Click
RetValue = Windows.Forms.DialogResult.OK
Frm.Dispose()
End Sub
Private Sub CmdYes_Click(ByVal sender As Object, ByVal e As _
System.EventArgs) Handles CmdYes.Click
Frm.Dispose()
RetValue = Windows.Forms.DialogResult.Yes
End Sub
Private Sub CmdNo_Click(ByVal sender As Object, ByVal e As _
System.EventArgs) Handles CmdNo.Click
Frm.Dispose()
RetValue = Windows.Forms.DialogResult.No
End Sub
Private Sub CmdRetry_Click(ByVal sender As Object, ByVal e As _
System.EventArgs) Handles CmdRetry.Click
Frm.Dispose()
RetValue = Windows.Forms.DialogResult.Retry
End Sub
Private Sub CmdCancel_Click(ByVal sender As Object, ByVal e As _
System.EventArgs) Handles CmdCancel.Click
Frm.Dispose()
RetValue = Windows.Forms.DialogResult.Cancel
End Sub
Private Sub CmdAbort_Click(ByVal sender As Object, ByVal e As _
System.EventArgs) Handles CmdAbort.Click
Frm.Dispose()
RetValue = Windows.Forms.DialogResult.Abort
End Sub
Private Sub CmdIgnore_Click(ByVal sender As Object, ByVal e As _
System.EventArgs) Handles CmdIgnore.Click
Frm.Dispose()
RetValue = Windows.Forms.DialogResult.Ignore
End Sub
End Class |