ITeye博客

.net

共 2 篇文章

DataGridView多行删除

首先得让DataGridView能选择多行; 设置属性MutiSelect = True 其次删除的时候要注意不能从前往后删除,因为若是这样删的话DataGridView的内容在循环的过程中就已经发生变化了。 Dim count As Integer = DataGridView1.SelectedRows.Count For i As Integer = count - 1 To 0 Step -1 DataGridView1.Rows.Remove(DataGridView1.SelectedRows(i)) Next

2008-05-15 14:17 · .net

写xml文件的方法(vb.net)

一:XmlWriter的形式 Dim myXmlSettings As New XmlWriterSettings myXmlSettings.Indent = True myXmlSettings.NewLineOnAttributes = True Using ProductWriter As XmlWriter = XmlWriter.Create("path\XMLFile2.xml", myXmlSettings) ProductWriter.WriteComment("product product ") ProductWriter.WriteStartElement("All"…

2008-05-09 17:31 · .net · VB.NET · VB · .net · XML