2 Replies - 8156 Views - Last Post: 23 April 2009 - 10:27 PM Rate Topic: -----

#1 sonia.sardana  Icon User is offline

  • D.I.C Head

Reputation: 5
  • View blog
  • Posts: 132
  • Joined: 01-June 08

Insert icon In ListView Column Header

Posted 23 April 2009 - 12:01 PM

hello frnds,I m able to insert the icon in ListView Column Header..
Steps-1) Drag the Imagelist.
2) Insert the iamges into the imagelist.
3)Associate the SmallImageList Property of Listview to Imagelist Name.

 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
		Dim lCount As Integer
		Dim lvitem As ListViewItem

		ListView1.Columns(0).ImageIndex = 0
		For lCount = 1 To 5
			lvitem = ListView1.Items.Add(lCount)
			lvitem.SubItems.Add("sonia" & lCount)
			Application.DoEvents()
		Next

	End Sub

	Private Sub ListView1_ColumnClick(ByVal sender As Object, ByVal e As System.Windows.Forms.ColumnClickEventArgs) Handles ListView1.ColumnClick
		If e.Column = 0 Then
			Select Case ListView1.Columns(0).ImageIndex
				Case 0
					ListView1.Columns(0).ImageIndex = 1
				Case 1
					ListView1.Columns(0).ImageIndex = 0
			End Select
		End If
	End Sub



When I click on ListView Column Headre..Image Changes Vice-Versa
.

Icon is inserted to the left of the text in Column Header..(See in Pic)..I want the icon to be inserted at the right & text at the left..

What to do??Plz help me out?/

Attached image(s)

  • Attached Image


Is This A Good Question/Topic? 0
  • +

Replies To: Insert icon In ListView Column Header

#2 SixOfEleven  Icon User is offline

  • using Caffeine;
  • member icon

Reputation: 945
  • View blog
  • Posts: 6,342
  • Joined: 18-October 08

Re: Insert icon In ListView Column Header

Posted 23 April 2009 - 01:00 PM

You could try and set the RightToLeftLayout property to true.
Was This Post Helpful? 0
  • +
  • -

#3 sonia.sardana  Icon User is offline

  • D.I.C Head

Reputation: 5
  • View blog
  • Posts: 132
  • Joined: 01-June 08

Re: Insert icon In ListView Column Header

Posted 23 April 2009 - 10:27 PM

Sir its not working..With that property..That u mention
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1