Wrox Programmer Forums
|
VB.NET 2002/2003 Basics For coders who are new to Visual Basic, working in .NET versions 2002 or 2003 (1.0 and 1.1).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB.NET 2002/2003 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 25th, 2004, 04:57 AM
Authorized User
 
Join Date: Jan 2004
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default Mouse Cursor

Hey Guys,
          I want to know if its possible to change the mouse to a shape and size that I want ,not one from the default list.

Thanks,
Dinesh

 
Old February 26th, 2004, 03:14 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 540
Thanks: 0
Thanked 4 Times in 4 Posts
Default

From the MSDN. See if this helps you.

----------------------------------------

[Visual Basic, C#, C++] The following example displays a form that demonstrates using a custom cursor by using the System.Windows.Forms.Cursor.#ctor constructor. The custom Cursor is embedded in the application’s resource file. The example assumes that you have a cursor contained in a cursor file named MyCursor.cur. To compile this example using the command line, include the following flag: /res:MyCursor.Cur, CustomCursor.MyCursor.Cur
[Visual Basic]
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





Similar Threads
Thread Thread Starter Forum Replies Last Post
Magnetic Cursor - Target Area Cursor? gcarcass .NET Framework 2.0 1 May 5th, 2008 07:20 AM
Mouse Ravikiran VB.NET 1 June 8th, 2007 04:57 PM
Word-unable to move cursor using mouse. jahid General .NET 0 February 6th, 2007 06:10 AM
Word-cursor position using mouse is not changing jahid Pro VB 6 2 February 6th, 2007 05:32 AM
Mouse-Cursor KennethMungwira HTML Code Clinic 5 August 27th, 2005 01:11 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.