|
Tipp 0140
|
Cursor aus Ressource laden
|
|
|
Autor/Einsender: Datum: |
|
Michael Werner 08.10.2006 |
|
Entwicklungsumgebung: |
|
VB.Net 2005 |
Framework: |
|
2.0 |
|
|
So verwenden Sie benutzerdefinierte Cursor als eingebettete Ressource:
|
1. Die *.cur-Datei in den Projektordner kopieren
|
2. Menü Projekt/Vorhandenes Element hinzufügen
|
3. Eigenschaft Buildaktion = Eingebettete Ressource
|
4. Me.Cursor = New Cursor(Me.GetType(), "Hand.cur")
|
5. ACHTUNG: Der Ressourcedateiname ist case-sensitiv, also Groß/-Kleinschreibung beachten.
|
|
|
Private Selected As String
Private Sub ListBox1_MouseDown(ByVal sender As Object, _
ByVal e As System.Windows.Forms.MouseEventArgs) Handles _
ListBox1.MouseDown
Me.Cursor = New Cursor(Me.GetType(), "BUSY_L.CUR")
Selected = ListBox1.SelectedItem.ToString
My.Computer.Clipboard.SetText(Selected)
End Sub
Private Sub TextBox1_MouseHover(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles TextBox1.MouseHover
TextBox1.Text = My.Computer.Clipboard.GetText
Me.Cursor = Cursors.Default
End Sub
Private Sub ListBox1_MouseHover(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles ListBox1.MouseHover
Me.Cursor = New Cursor(Me.GetType(), "Pipette.cur")
End Sub
Private Sub Button1_MouseHover(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles Button1.MouseHover
Me.Cursor = New Cursor(Me.GetType(), "Hand.cur")
End Sub
Private Sub Button2_MouseHover(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles Button2.MouseHover
Me.Cursor = New Cursor(Me.GetType(), "Hand.cur")
End Sub
Private Sub Form1_MouseHover(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles Me.MouseHover
Me.Cursor = Cursors.Default
End Sub
|
|
|
|
|
Windows-Version |
98/SE |
|
|
ME |
|
|
NT |
|
|
2000 |
|
|
XP |
|
|
Vista |
|
|
Win
7 |
|
|
|
|
Download (19,4
kB)
|
Downloads bisher: [ 367 ]
|
|
|