PDA

View Full Version : سوال: سوال درباره استفاده از Embedded Custom Cursor



nunegandom
دوشنبه 29 خرداد 1391, 15:51 عصر
سلام، چطوری میتونم از Embedded Custom Cursor استفاده کنم؟
چندتا لینک تویه نت پیدا کردم ولی نتونستم باهاشون کار کنم! بجز پسوند .cur
چطور میتونم از png هم استفاده کنم؟

یه سوال دیگه هم دارم، از Properties.Resources ها چطوری میتونم استفاده کنم؟ لینکی، سورسی اگه دارید در اختیارم بذارید، خیلی ممنونم :)

tooraj_azizi_1035
دوشنبه 29 خرداد 1391, 16:02 عصر
سلام

لینک اصلی:
http://msdn.microsoft.com/en-us/library/system.windows.forms.cursor%28v=VS.80%29.aspx

یک لینک برای آموزش گام به گام:

http://www.switchonthecode.com/tutorials/csharp-tutorial-how-to-use-custom-cursors


using System;
using System.Drawing;
using System.Windows.Forms;

namespace CustomCursor
{
public class Form1 : System.Windows.Forms.Form
{
[STAThread]
static void Main()
{
Application.Run(new Form1());
}

public Form1()
{
this.ClientSize = new System.Drawing.Size(292, 266);
this.Text = "Cursor Example";

// 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
//
// Where "Namespace" is the namespace in which you want to use the cursor
// and "CursorFileName.Cur" is the cursor filename.

// 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.
this.Cursor = new Cursor(GetType(), "MyCursor.Cur");

}
}
}

nunegandom
دوشنبه 29 خرداد 1391, 16:13 عصر
دقیقا همینا رو دیدم، کار نکرد! سورس Build شده ای ، چیزی در این رابطه ندارید؟

nunegandom
دوشنبه 29 خرداد 1391, 21:49 عصر
upppppppppppppp toooooooopiiiiiiiiiiiiiiiicccccccccccccccc

nunegandom
جمعه 02 تیر 1391, 19:11 عصر
tooooooooooopiiiiiiiiic uppppppppppppppp