Ciao sto sviluppando una piccola applicazione , e vorrei inserire un cursore che ho creato io , praticamente lo vorrei importare nel progetto ma non ci riesco , sapete come fare?
![]()
Ciao sto sviluppando una piccola applicazione , e vorrei inserire un cursore che ho creato io , praticamente lo vorrei importare nel progetto ma non ci riesco , sapete come fare?
![]()
Ho Trovato in giro per il web questo :
Nell'esempio riportato di seguito viene visualizzato un form che illustrato l'utilizzo di un cursore personalizzato. L'oggetto Cursor personalizzato è incorporato nel file di risorse dell'applicazione. Nell'esempio, è prevista la presenza di un cursore contenuto in un file di cursore denominato MyCursor.cur. Per compilare l'esempio dalla riga di comando, includere il seguente flag: /res:MyCursor.Cur, CustomCursor.MyCursor.Cur.
Imports System
Imports System.Drawing
Imports System.Windows.Forms
Namespace CustomCursor
Public Class Form1
Inherits System.Windows.Forms.Form
<System.STAThread()> _
Public Shared Sub Main()
System.Windows.Forms.Application.Run(New Form1())
End Sub 'Main
Public Sub New()
Me.ClientSize = New System.Drawing.Size(292, 266)
Me.Text = "Cursor Example"
' Looks namespace.MyCursor.cur in the assemblies manifest.
' The following generates a cursor from an embedded resource.
' To add a custom cursor, create or use an existing 16x16 bitmap
' 1. Add a new cursor file to your project:
' File->Add New Item->Local Project Items->Cursor File
' 2. Select 16x16 image type:
' Image->Current Icon Image Types->16x16
' --- To make the custom cursor an embedded resource ---
' In Visual Studio:
' 1. Select the cursor file in the Solution Explorer
' 2. Choose View->Properties.
' 3. In the properties window switch "Build Action" to "Embedded"
' On the command line:
' Add the following flag:
' /res:CursorFileName.Cur,Namespace.CursorFileName.Cu r
'
' The following line uses the namespace from the passed-in type
' and looks for CustomCursor.MyCursor.Cur in the assemblies manifest.
' NOTE: The cursor name is acase sensitive.
Me.Cursor = New Cursor(Me.GetType(), "MyCursor.Cur")
End Sub 'New
End Class 'Form1
End Namespace 'CustomCursor
non ho capito come si include una flag , sapete come si fà?Per compilare l'esempio dalla riga di comando, includere il seguente flag: /res:MyCursor.Cur, CustomCursor.MyCursor.Cur.![]()