Microsoft Communities

Welcome to WindowsClient.net | Sign in | Join

Here are some frequently asked questions about Windows Forms and their answers.

Windows Forms FAQs

How do I load and display a cursor from a resource manifest?

System.IO.Stream stream = null; 
try 
{ 
  string curName = "WindowsApplication1.Cursor1.cur"; 
  stream = GetType().Assembly.GetManifestResourceStream(curName); 
  this.Cursor = new Cursor( stream ); 
} 
catch ( Exception ex ) 
{ 
  MessageBox.Show(ex.Message.ToString()); 
} 
finally 
{ 
  if ( stream != null ) 
    stream.Close(); 
}

Contributed from George Shepherd's Windows Forms FAQ



Page view counter