Nesse exemplo mostro como criar uma rotina extremamente simples para a visualização de uma barra de progresso no LCD

Usar no Visual Studio 12 ou superior.


Fazer o download:


[VBNET] Formulário com skin e transparencia  


Segue o código: [sections] [section title="Código Fonte"] [vbnet] Public Class FormSkin Dim _bit As Integer Dim _p2 As Size Private Sub UserControl1Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load ParentForm.FormBorderStyle = FormBorderStyle.None Dock = DockStyle.Fill ParentForm.TransparencyKey = Color.FromArgb(255, 0, 255) DoubleBuffered = True End Sub Private Sub FormSkinMouseDown(sender As Object, e As Windows.Forms.MouseEventArgs) Handles Me.MouseDown, Label1.MouseDown 'barra If (e.Location.X > 100) And (e.Location.Y < 60) Then _bit = 1 _p2 = e.Location End If 'botão If (e.Location.X < 90) And (e.Location.Y < 90) Then _bit = 1 _p2 = e.Location End If End Sub Private Sub FormSkinMouseMove(sender As Object, e As Windows.Forms.MouseEventArgs) Handles Me.MouseMove, Label1.MouseMove If _bit = 1 Then ParentForm.Location = Point.Add(ParentForm.Location, (Point.Subtract(e.Location, _p2))) End If End Sub Private Sub FormSkinMouseUp(sender As Object, e As Windows.Forms.MouseEventArgs) Handles Me.MouseUp, Label1.MouseUp _bit = 0 End Sub Private Sub UserControl1Paint(ByVal sender As Object, ByVal e As PaintEventArgs) Handles Me.Paint SendToBack() End Sub Private Sub Panel1MouseHover(sender As System.Object, e As EventArgs) Handles Panel1.MouseHover Panel1.BackgroundImage = My.Resources.ButtonHover End Sub Private Sub Panel1MouseDown(sender As System.Object, e As Windows.Forms.MouseEventArgs) Handles Panel1.MouseDown Panel1.BackgroundImage = My.Resources.ButtonClick End Sub Private Sub Panel1MouseUp(sender As System.Object, e As Windows.Forms.MouseEventArgs) Handles Panel1.MouseUp Panel1.BackgroundImage = My.Resources.ButtonHover End Sub Private Sub Panel1MouseLeave(sender As System.Object, e As EventArgs) Handles Panel1.MouseLeave Panel1.BackgroundImage = My.Resources.ButtonNormal End Sub Private Sub Panel1_Paint(sender As Object, e As PaintEventArgs) Handles Panel1.Paint End Sub End Class [/vbnet] [/section] [section title="Visualização"]
Imagem de Form Skin
Imagem de Form Skin
[/section] [/sections]
Obrigado e até o próximo post.

DATEK Tecnologia Eletrônica
[VB.NET] Formulário com skin e transparência
Tags:                     

Deixe uma resposta

%d blogueiros gostam disto: