Click here to Skip to main content
15,914,608 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionRe: Null value error Pin
str5010-Jul-06 12:10
str5010-Jul-06 12:10 
AnswerRe: Null value error Pin
Christian Graus10-Jul-06 12:14
protectorChristian Graus10-Jul-06 12:14 
GeneralRe: Null value error Pin
str5010-Jul-06 12:19
str5010-Jul-06 12:19 
AnswerRe: Null value error Pin
Colin Angus Mackay10-Jul-06 12:07
Colin Angus Mackay10-Jul-06 12:07 
QuestionRe: Null value error Pin
str5010-Jul-06 12:11
str5010-Jul-06 12:11 
AnswerRe: Null value error Pin
Colin Angus Mackay10-Jul-06 20:21
Colin Angus Mackay10-Jul-06 20:21 
QuestionRe: Null value error Pin
str5011-Jul-06 0:18
str5011-Jul-06 0:18 
QuestionMoving ListViewItem [modified] Pin
MAP Tiger10-Jul-06 9:53
MAP Tiger10-Jul-06 9:53 
Hi guys

I am working on a ListView control and i want to move the items up and down. I already have applied the logic and it is successfull but with a problem as it works best when moving the item up either single item or multiple items but when i move the item down then if single then it works perfectly but in the case of moveing down multiple items then it fails. Here is the code:

For moving the item down:-

Private Sub movedown()
If Not ListView1.SelectedItems.Count = 0 Then
Dim myItem As Integer
For Each myItem In ListView1.SelectedIndices
If myItem = ListView1.Items.Count - 1 Then
Exit Sub
Else
Dim myitem2 As New ListViewItem
myitem2 = ListView1.Items.Item(myItem)

ListView1.Items.RemoveAt(ListView1.Items.IndexOf(myitem2))
ListView1.Items.Insert(myItem + 1, myitem2)
End If
Next
End If
End Sub

For moving the item Up:-

Private Sub moveup()
If Not ListView1.SelectedItems.Count = 0 Then
Dim myItem As Integer
For Each myItem In ListView1.SelectedIndices
If myItem = 0 Then
Exit Sub
Else
Dim myitem2 As New ListViewItem
myitem2 = ListView1.Items.Item(myItem)

ListView1.Items.RemoveAt(myItem)

ListView1.Items.Insert(myItem - 1, myitem2)
End If
Next
End If
End Sub

Please guys provide me help in soling the problem.

Thanks.

MAP Tiger
Tiger Softwares

Software Designer and Developer
VB.NET, ASP.NET, VFP

-- modified at 15:54 Monday 10th July, 2006
AnswerRe: Moving ListViewItem Pin
kumarprabhakar7410-Jul-06 20:18
kumarprabhakar7410-Jul-06 20:18 
GeneralRe: Moving ListViewItem Pin
MAP Tiger10-Jul-06 21:15
MAP Tiger10-Jul-06 21:15 
GeneralRe: Moving ListViewItem Pin
MAP Tiger10-Jul-06 22:10
MAP Tiger10-Jul-06 22:10 
Question.net 1.1 Vs 2.0 Pin
huckeuri10-Jul-06 8:41
huckeuri10-Jul-06 8:41 
QuestionSmtpMail Pin
lula12310-Jul-06 8:02
lula12310-Jul-06 8:02 
GeneralRe: SmtpMail [modified] Pin
Guffa10-Jul-06 9:42
Guffa10-Jul-06 9:42 
AnswerRe: SmtpMail Pin
Steven J Jowett10-Jul-06 21:24
Steven J Jowett10-Jul-06 21:24 
QuestionDeployment project MsiLoadr.bin issue Pin
Mondis10-Jul-06 6:13
Mondis10-Jul-06 6:13 
Questionhow to use intellisence for functions Pin
<b<font color="#6EA3C4">MILAN@Cybage10-Jul-06 3:06
<b<font color="#6EA3C4">MILAN@Cybage10-Jul-06 3:06 
QuestionRestart Thread in 2003 Pin
Rizwan Bashir10-Jul-06 2:09
Rizwan Bashir10-Jul-06 2:09 
AnswerRe: Restart Thread in 2003 Pin
Dave Kreskowiak10-Jul-06 2:22
mveDave Kreskowiak10-Jul-06 2:22 
QuestionHow do I make a form opening only the first time [modified] Pin
Bruno Gonçalves10-Jul-06 1:56
Bruno Gonçalves10-Jul-06 1:56 
AnswerRe: How do I make a form opening only the first time Pin
Dave Sexton10-Jul-06 2:14
Dave Sexton10-Jul-06 2:14 
GeneralRe: How do I make a form opening only the first time Pin
Bruno Gonçalves10-Jul-06 6:25
Bruno Gonçalves10-Jul-06 6:25 
AnswerRe: How do I make a form opening only the first time Pin
Rizwan Bashir10-Jul-06 2:17
Rizwan Bashir10-Jul-06 2:17 
GeneralRe: How do I make a form opening only the first time Pin
Steven J Jowett10-Jul-06 21:33
Steven J Jowett10-Jul-06 21:33 
GeneralRe: How do I make a form opening only the first time Pin
Bruno Gonçalves12-Jul-06 0:21
Bruno Gonçalves12-Jul-06 0:21 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.