Как сделать круглую кнопку? - Visual Basic .NET
Формулировка задачи:
Как сделать круглую кнопку?
Решение задачи: «Как сделать круглую кнопку?»
textual
Листинг программы
Private Sub Form5_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load With OvalShape1 .BackColor = Color.Red .BorderColor = Me.BackColor .BorderStyle = Drawing2D.DashStyle.Solid .BorderWidth = 5 .FillColor = Color.DarkGreen .FillGradientColor = Color.Lime .FillGradientStyle = PowerPacks.FillGradientStyle.ForwardDiagonal .FillStyle = PowerPacks.FillStyle.Solid .SelectionColor = Me.BackColor .Tag = "кнопка 1" End With 'для остальных аналогично End Sub '... Private Sub Oval_MouseDown(sender As System.Object, e As System.Windows.Forms.MouseEventArgs) Handles OvalShape1.MouseDown, OvalShape2.MouseDown, OvalShape3.MouseDown Dim ov As Microsoft.VisualBasic.PowerPacks.OvalShape = CType(sender, Microsoft.VisualBasic.PowerPacks.OvalShape) ov.BorderColor = Color.Red End Sub Private Sub Oval_MouseUp(sender As System.Object, e As System.Windows.Forms.MouseEventArgs) Handles OvalShape1.MouseUp, OvalShape2.MouseUp, OvalShape3.MouseUp Dim ov As Microsoft.VisualBasic.PowerPacks.OvalShape = CType(sender, Microsoft.VisualBasic.PowerPacks.OvalShape) ov.BorderColor = Color.WhiteSmoke End Sub Private Sub Oval_MouseMove(sender As System.Object, e As System.Windows.Forms.MouseEventArgs) Handles OvalShape3.MouseMove, OvalShape2.MouseMove, OvalShape1.MouseMove Dim ov As Microsoft.VisualBasic.PowerPacks.OvalShape = CType(sender, Microsoft.VisualBasic.PowerPacks.OvalShape) ToolStripStatusLabel1.Text = ov.Tag End Sub Private Sub OvalShape1_MouseLeave(sender As System.Object, e As System.EventArgs) Handles OvalShape3.MouseLeave, OvalShape2.MouseLeave, OvalShape1.MouseLeave Dim ov As Microsoft.VisualBasic.PowerPacks.OvalShape = CType(sender, Microsoft.VisualBasic.PowerPacks.OvalShape) ToolStripStatusLabel1.Text = "" End Sub
ИИ поможет Вам:
- решить любую задачу по программированию
- объяснить код
- расставить комментарии в коде
- и т.д