Guest User

Untitled

a guest
Jul 21st, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. myMagCursor = new Cursor("../Resources/magnify.cur");
  2.  
  3. //In Visual Studio:
  4. // 1. Select the cursor file in the Solution Explorer
  5. // 2. Choose View->Properties.
  6. // 3. In the properties window switch "Build Action" to "Embedded"
  7.  
  8. myMagCursor = new Cursor(GetType(), "magnify.cur");
  9.  
  10. namespace Piccolo.Forms
  11. {
  12. public partial class Hanger
  13. {
  14. ...
  15. Assembly asm = Assembly.GetExecutingAssembly();
  16. using( Stream resStream = asm.GetManifestResourceStream("Piccolo.magnify.cur") )
  17. {
  18. myMagCursor = new Cursor( resStream );
  19. }
  20.  
  21. canvas1.Cursor = new Cursor(Assembly.GetExecutingAssembly().GetManifestResourceStream("WpfApplication2.mallet.cur"));
  22.  
  23. String[] resourceNames = Assembly.GetExecutingAssembly().GetManifestResourceNames();
  24.  
  25. using (MemoryStream ms = new MemoryStream(Properties.Resources.magnify))
  26. {
  27. myMagCursor = New Cursor(ms);
  28. }
  29.  
  30. this.Cursor = new Cursor(new System.IO.MemoryStream(Properties.Resources.arrow_i));
Add Comment
Please, Sign In to add comment