RE: Opening multiple files with my applicaton





"kimiraikkonen" wrote:

Hi,
I have an app which has a listbox and when i double click an
associated fileS, i want their paths to be added into listbox in my
application.

This code works good when i try to open a "single" file with my app
which works to get commandline arguments to get file paths:

Dim cla As String() = Environment.GetCommandLineArgs()
If cla.Length > 1 Then
ListBox1.Items.Add(cla(1))
End if

But this doesn't work while opening more than one files at the same
time.


You are only adding the first item from the command line. Change your code
to:

Dim cla As String() = Environment.GetCommandLineArgs()
Dim idx as Integer

If cla.Length > 1 Then
for idx = 1 to (cla.Length-1)
ListBox1.Items.Add(cla(idx))
next idx
endif


.



Relevant Pages

  • Re: Opening multiple files with my applicaton
    ... Dim cla As String() = Environment.GetCommandLineArgs ... i want their paths to be added into listbox in my ... This code works good when i try to open a "single" file with my app ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Opening multiple files with my applicaton
    ... i want their paths to be added into listbox in my ... Dim cla As String= Environment.GetCommandLineArgs ... Dim idx as Integer ... try to open more than one file "with" my app by selecting CTRL + mouse ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Advice Needed...
    ... items in a listbox). ... What about access controls is better? ... looking) is that they can handle multi-column data, where a VB6 listbox ... The only real issue is the problems when an app shuts down unexpectedly. ...
    (microsoft.public.vb.general.discussion)
  • Re: Unable to select row in listbox
    ... idx = idx + 1 ... The On Click event for the listbox runs: ... Row Source Type: Value List ... field from teh data view of the table. ...
    (microsoft.public.access.forms)
  • Re: Random listbox item selection
    ... How can i select next listbox item without obeying array order? ... Dim r As New Random ... Dim idx As Integer ... Still, the selection goes endless,never ends. ...
    (microsoft.public.dotnet.languages.vb)