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

Visual Basic

 
QuestionWindow Service Accesing folder Pin
nitin_ion13-Dec-06 5:55
nitin_ion13-Dec-06 5:55 
AnswerRe: Window Service Accesing folder Pin
nlarson1113-Dec-06 10:25
nlarson1113-Dec-06 10:25 
GeneralRe: Window Service Accesing folder Pin
nitin_ion13-Dec-06 16:43
nitin_ion13-Dec-06 16:43 
GeneralRe: Window Service Accesing folder Pin
nlarson1114-Dec-06 3:28
nlarson1114-Dec-06 3:28 
GeneralRe: Window Service Accesing folder Pin
nitin_ion14-Dec-06 16:52
nitin_ion14-Dec-06 16:52 
Questionplease help !!!! Pin
peteyshrew13-Dec-06 4:03
peteyshrew13-Dec-06 4:03 
GeneralRe: please help !!!! Pin
Guffa13-Dec-06 4:07
Guffa13-Dec-06 4:07 
AnswerRe: please help !!!! [modified] Pin
The ANZAC13-Dec-06 18:26
The ANZAC13-Dec-06 18:26 
oh i think i understand, you want the selected item on button press to have the same value as the next or previous item.

If that is the case:
Make sure your listbox selectionmode = selectionmode.multiextended

Select all:
ListBox1().SelectionMode = SelectionMode.MultiExtended<br />
    For i As Integer = 0 To Me.ListBox1.Items.Count - 1<br />
        Me.ListBox1.SetSelected(i, True)<br />
    Next


Change current to same as previous:
        ListBox1().SelectionMode = SelectionMode.One<br />
        Dim Selected As Integer = Me.ListBox1.SelectedIndex<br />
        Dim newItem As String<br />
<br />
        If Me.ListBox1.SelectedIndex > 0 Then<br />
            newItem = Me.ListBox1.Items.Item(Selected - 1)<br />
            Me.ListBox1.Items.RemoveAt(Selected)<br />
            Me.ListBox1.Items.Insert(Selected, newItem)<br />
            Me.ListBox1.SelectedIndex = Selected<br />
        End If


Change current to same as next:
    ListBox1().SelectionMode = SelectionMode.One<br />
        Dim Selected As Integer = Me.ListBox1.SelectedIndex<br />
        Dim newItem As String<br />
<br />
        If Me.ListBox1.SelectedIndex < Me.ListBox1.Items.Count - 1 Then<br />
            newItem = Me.ListBox1.Items.Item(Selected + 1)<br />
            Me.ListBox1.Items.RemoveAt(Selected)<br />
            Me.ListBox1.Items.Insert(Selected, newItem)<br />
            Me.ListBox1.SelectedIndex = Selected<br />
        End If


Posted by The ANZAC

QuestionHelp With Treeviews Pin
J. Sebby13-Dec-06 3:59
J. Sebby13-Dec-06 3:59 
AnswerRe: Help With Treeviews Pin
Dave Sexton13-Dec-06 19:44
Dave Sexton13-Dec-06 19:44 
Questionmultiple currencies in one datagrid column Pin
Elwood Baker13-Dec-06 3:52
Elwood Baker13-Dec-06 3:52 
QuestionColumn from dataset not in xml file Pin
RainFox13-Dec-06 2:48
RainFox13-Dec-06 2:48 
Questionselected items in list Pin
peteyshrew13-Dec-06 2:02
peteyshrew13-Dec-06 2:02 
GeneralRe: selected items in list Pin
Guffa13-Dec-06 4:08
Guffa13-Dec-06 4:08 
Questionnotepad Pin
peteyshrew13-Dec-06 1:53
peteyshrew13-Dec-06 1:53 
AnswerRe: notepad Pin
Pete O'Hanlon13-Dec-06 2:30
mvePete O'Hanlon13-Dec-06 2:30 
QuestionExporting crystal report to excel issue Pin
Niruththigan13-Dec-06 0:51
Niruththigan13-Dec-06 0:51 
Questionitem selecting in list Pin
peteyshrew12-Dec-06 22:15
peteyshrew12-Dec-06 22:15 
AnswerRe: item selecting in list Pin
The ANZAC12-Dec-06 23:16
The ANZAC12-Dec-06 23:16 
GeneralRe: item selecting in list Pin
peteyshrew13-Dec-06 0:27
peteyshrew13-Dec-06 0:27 
QuestionPrinting the full Datagrid Pin
Rajiya12-Dec-06 22:02
Rajiya12-Dec-06 22:02 
QuestionVideo Conferencing in VB.net Pin
mikcoyen12-Dec-06 20:33
mikcoyen12-Dec-06 20:33 
JokeRe: Video Conferencing in VB.net Pin
Dave Sexton13-Dec-06 19:50
Dave Sexton13-Dec-06 19:50 
QuestionDatabase Explorer Modify Connection Pin
vbbeg12-Dec-06 14:20
vbbeg12-Dec-06 14:20 
AnswerRe: Database Explorer Modify Connection Pin
Kschuler13-Dec-06 6:28
Kschuler13-Dec-06 6:28 

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.