Jump to content
ferreira12

ListView colocar checkBoxes

Recommended Posts

ferreira12

Boas...

Eu gostaria de colocar na minha listview um checkBoxes, mas se eu usar o código abaixo coloca-me só na segunda coluna, e eu gostaria de colocar na 3ª coluna como faria?

LV.CheckBoxes = True

Share this post


Link to post
Share on other sites
jlpcalado

Experimenta e adapta o código.

Dim myCheckFont As New System.Drawing.Font("Wingdings", 14, FontStyle.Regular)
 ListView1.Columns.Add("Id")
 ListView1.Columns.Add("Teste")
 ListView1.Columns.Add("Check")
 For i = 0 To 5
	 Dim it As New ListViewItem
	 it.Text = i
	 it.UseItemStyleForSubItems = False
	 it.SubItems.Add("Teste" + i.ToString)
	 If i Mod 2 = 0 Then
		 it.SubItems.Add(Chr(168))
	 Else
		 it.SubItems.Add(Chr(254))
	 End If
	 it.SubItems(2).Font = myCheckFont
	 it.SubItems(2).ForeColor = Color.Black
	 ListView1.Items.Add(it)
 Next

Edited by apocsantos
geshi

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.