IWETHEY v. 0.3.0 | TODO
1,095 registered users | 0 active users | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New That's nasty
And yes, I hate this "language" so much I'm
trying to avoid coding if possible. But looks
like I have no choice.

Care to tell me how to loop over the currently
selected items in a multi select list combo box.

I've tried deleting by index entries, selected
items, collections of indices, and other various
combinations.

At list point I'm deleting the 1st highlit one
and forcing the user to jot the button once for
each one, which I consider wrong.
New Re: That's nasty
If I had VB Classic here I'd give you actual tested code, but I only have VB.Net which will be different, so I'll have to refer to TFM:

[link|http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vb98/html/vbpromultiselectx.asp|http://msdn.microsof...omultiselectx.asp]

and modify the example thusly:
\nPrivate Sub Command1_Click ()\n   Dim I\n\n   For I = 0 To List1.ListCount - 1\n      If List1.Selected(I) Then\n         List1.RemoveItem I\n      End If\n   Next I\nEnd Sub\n


A ComboBox can't have multiple select so I assume you misworded that and meant ListBox.

Also, here is an info on getting multiple filenames back from the File Open common dialog:
[link|http://vbnet.mvps.org/index.html?code/faq/cdlgmultiselect.htm|http://vbnet.mvps.or...lgmultiselect.htm]

--
Chris Altmann
New I'm VB Net as well
I got the multi-file names from box and loaded into the box.

But it doesn't seem that your code will work for me. Yes, trying to morph it to fit my scenario.

My "DataFileBox" is defined as a ListBox. ListBox does not have a ListCount. It seems you are referring to the Item() which is an ObjectCollection, which has a Count(). But then you check to see if the same indexed value is turned on in the Selected list. But the Selected list is a subset of the real list, and the indexes into to that should be the actual index into THAT list, not the matching index in the total list.

Am I using the wrong collection to start off with?
New My fault
I remembered a recent post by you (it was you wasn't it?) where you decided not to go with the latest greatest .Net and stick with the tried and true classic VB.

My code probably wouldn't work to well in VB.net.

I'll get you something more appropriate in a sec.
--
Chris Altmann
New No choice
You can't buy a VB that is not .NET. On the other hand, I'm treating it as a standalone program.
New VB.Net is far better anyways IMHO
Try this:
\n   Private Sub filenameBrowseButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles filenameBrowseButton.Click\n        If filenameDialog.ShowDialog() = DialogResult.OK Then\n            filenameTextBox.Text = filenameDialog.FileName\n        End If\n    End Sub\n\n    Private Sub addFilesButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles addFilesButton.Click\n        Dim fileName As String\n\n        If addFilesDialog.ShowDialog() = DialogResult.OK Then\n            For Each fileName In addFilesDialog.FileNames\n                filesListbox.Items.Add(fileName)\n            Next\n        End If\n    End Sub\n\n    Private Sub removeFilesButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles removeFilesButton.Click\n        While filesListbox.SelectedIndices.Count > 0\n            filesListbox.Items.RemoveAt(filesListbox.SelectedIndex)\n        End While\n    End Sub\n


--
Chris Altmann
New And re the INI files
You'll have to a find a wrapper similar to the one I posted to get to the old Win32 APIs for INI files from .Net

This might do the job:

[link|http://www.developer.com/net/asp/article.php/3287991|http://www.developer...ticle.php/3287991]

--
Chris Altmann
New Thanks, remove is good
The others I already coded using essential the same, except I stripped the full path.
     VB File pick list question - (broomberg) - (19)
         its built into browsers - (boxley) - (1)
             I got THAT part - (broomberg)
         Modal dialog box - (ChrisR) - (1)
             I must be emanating stupidity here - (broomberg)
         What's in the control file? - (lincoln) - (1)
             Ahh, close - (broomberg)
         Follow up - (broomberg) - (12)
             Re: Follow up - (altmann)
             Re: INI files - (altmann) - (10)
                 Is there such a thing as a multiline INI entry? -NT - (broomberg) - (9)
                     Re: Is there such a thing as a multiline INI entry? - (altmann) - (8)
                         That's nasty - (broomberg) - (7)
                             Re: That's nasty - (altmann) - (6)
                                 I'm VB Net as well - (broomberg) - (5)
                                     My fault - (altmann) - (4)
                                         No choice - (broomberg) - (3)
                                             VB.Net is far better anyways IMHO - (altmann) - (2)
                                                 And re the INI files - (altmann)
                                                 Thanks, remove is good - (broomberg)

I enjoy this motorcade and will recommend it to my niece.
50 ms