Mega Code Archive

 
Categories / VB.Net Tutorial / GUI
 

Add image to Label

imports System imports System.Drawing imports System.Windows.Forms public class LabelImage: inherits Form   public sub New()     Size = new Size(300,250)     dim img as Image = Image.FromFile("yourfile.jpg")     dim lblImage as Label = new Label()     lblImage.Parent = me     lblImage.Location = new Point(0, 0)     lblImage.Image = img     lblImage.Anchor = AnchorStyles.Top or AnchorStyles.Right     lblImage.Size = new Size(img.Width, img.Height)   end sub   public shared sub Main()      Application.Run(new LabelImage())   end sub end class