Add image to Label : Label « GUI « VB.Net Tutorial

Home
VB.Net Tutorial
1.Language Basics
2.Data Type
3.Operator
4.Statements
5.Date Time
6.Class Module
7.Development
8.Collections
9.Generics
10.Attributes
11.Event
12.LINQ
13.Stream File
14.GUI
15.GUI Applications
16.Windows Presentation Foundation
17.2D Graphics
18.I18N Internationlization
19.Reflection
20.Regular Expressions
21.Security
22.Socket Network
23.Thread
24.Windows
25.XML
26.Database ADO.net
27.Design Patterns
VB.Net
VB.Net by API
VB.Net Tutorial » GUI » Label 
14.2.6.Add image to Label
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(00)
    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
14.2.Label
14.2.1.Label TextAlignLabel TextAlign
14.2.2.Change Label text and width in Button actionChange Label text and width in Button action
14.2.3.Change Label fontChange Label font
14.2.4.Use Color dialog to set the Label foreground colorUse Color dialog to set the Label foreground color
14.2.5.Label mouse click eventLabel mouse click event
14.2.6.Add image to LabelAdd image to Label
14.2.7.Set Label's ImageListSet Label's ImageList
14.2.8.Multiline LabelMultiline Label
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.