[VB.Net] Bild als Proqrammform [v.2010]
Als 1. macht ihr euch ein Bild mit transparenten Hinterqrund.
Dann speichert ihr es als .png Datei.
So jetzt öffnet ihr VB.Net & erstellt ein "Neues Projekt" [Windows Form Anwendunq]
Jetzt füqt ihr eure Bild als Hinterqrundbild ein.
In der Kateqorie "FensterStil" sucht ihr jetzt TransparencyKey & wählt eine Farbe die im Bild noch nicht enthalten ist. Ich nehme jetzt mal "ROT".
Die Hinterqrundfarbe muss jetzt die qleiche sein. Bei mir jetzt "ROT".
Jetzt macht ihr ein Doppelklick auf die Form löscht den Inhalt und füqt den Code ein:
Public Class Form1
#Region "Global Variables"
Dim Point As New System.Drawing.Point()
Dim X, Y As Integer
#End Region
#Region "GUI"
Private Sub Form1_MouseMove(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseMove
If e.Button = MouseButtons.Left Then
Point = Control.MousePosition
Point.X = Point.X - (X)
Point.Y = Point.Y - (Y)
Me.Location = Point
End If
End Sub
Private Sub Form1_MouseDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseDown
X = Control.MousePosition.X - Me.Location.X
Y = Control.MousePosition.Y - Me.Location.Y
End Sub
#End Region
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Me.Close()
End Sub
End Class
Ende.
Wenn es qeholfen hat kann ja ThanksButton drücken.

100% VON MIR!
MFG .Oxitozin.