How do I autosize a button to fit its text

Get a Graphics object for the button and use its MeasureString method to compute the width you need. Graphics g = button1.CreateGraphics(); float w = g.MeasureString(button1.Text, button1.Font).Width; g.Dispose(); button1.Width = (int)w + 12; // 12 is for the margins

Is there any easy way to convert VB.NET code to C#?

If you add a BMP file to your solution using the File|Add Existing Item… Menu Item, then change the Build Action property of this BMP file to Embedded Resource, you can then access this resource with code similar to: // WindowsApplication6 corresponds to Default Namespace in your project settings. // subfolders should be the folder names if any, inside which the bmp is added. If the bmp was added to the top level, you don’t have to specify anything here. string bmpName = 'WindowsApplication6.subfolders.sync.bmp'; System.IO.Stream strm = null; try { strm = this.GetType().Assembly.GetManifestResourceStream(bmpName); pictureBox1.Image = new Bitmap(strm); // Do the same for Icons // Icon icon1 = new Icon(strm); } catch(Exception e) { MessageBox.Show(e.Message); } finally { if(strm != null) strm.Close(); }

How to draw a faded image?

The trick is to use an alpha component while drawing the image. // transparency should be in the range 0 to 1 protected void DrawScrollImage(Graphics g, Rectangle rect, Image image, float transparency) { ImageAttributes ia = new ImageAttributes(); ColorMatrix cm = new ColorMatrix(); cm.Matrix00 = 1; cm.Matrix11 = 1; cm.Matrix22 = 1; cm.Matrix33 = transparency; ia.SetColorMatrix(cm); g.DrawImage(image, rect, 0, 0, image.Width, image.Height, GraphicsUnit.Pixel, ia); }

How does .NET support licensing

LicFileLicenseProvider is the only license provider shipped with .NET. A good discussion of licensing techniques along with sample code can be found in an article by Mike Harsh at gotnetdot.com.