Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
I've found it. but fails part I marked ?

Bitmap bmp = new Bitmap("sineklik.png");
ico == Icon.FromHandle(bmp.GetHicon); ---> why does it make mistakes?
customCursor = new Cursor(ico.Handle);
this.UseWaitCursor = false;
this.Cursor = customCursor;
Posted
Comments
Vladimir Svyatski 16-Feb-15 14:01pm    
Are you sure your image is of proper size? It must be 32x32 (I believe all the cursors in Windows have that size). Also, you could try to create some CUR files from your PNGs and load them.
Sergey Alexandrovich Kryukov 16-Feb-15 14:34pm    
"Visual Basic C++"? What are you talking about?
'==' is a Boolean operator. In your code fragment, without assignment or "if", it makes no sense at all.
—SA
[no name] 16-Feb-15 14:48pm    
I really beginner. I've never read a school for software .I'm just trying monopoly buffet. I'm trying to learn software . I know very little english I apologize .

1 solution

At a brief glance
C++
ico == Icon.FromHandle(bmp.GetHicon); // error should not be "=="
// should be 
ico = Icon.FromHandle(bmp.GetHicon);

However, your title mentions Visual Basic so there may be other issues. Please edit your question and explain exactly what error you see.
 
Share this answer
 
Comments
[no name] 16-Feb-15 14:15pm    
Error1 The best overloaded method match for 'System.Drawing.Icon.FromHandle(System.IntPtr)' has some invalid arguments
Error 2 Argument 1: cannot convert from 'method group' to 'System.IntPtr'
Error 3 The name 'customCursor' does not exist in the current context
Error 4 The name 'customCursor' does not exist in the current context
-------------------------------------------------------------------------------
or to me. c ++ language in the picture cursor forum can give you a code to add really fast?
Sergey Alexandrovich Kryukov 16-Feb-15 14:37pm    
Here is my advice: stop thinking about "really fast". Think about learning programming at least to get some clues on how to do it. Otherwise you cannot get anything except total waste of time and frustration. Honestly...
—SA
Richard MacCutchan 17-Feb-15 3:10am    
Good advice.
Sergey Alexandrovich Kryukov 16-Feb-15 14:36pm    
5ed, but now, undeclared ico or declared who knows where...
I would rather advice the inquirer to learn the language just a bit, at least learn its name... :-)
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900