🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: free.it.visual-basic
Article #905

Re: Box Select File

#905
From: ~Incoming
Date: Wed, 23 Feb 2005 13:35
52 lines
2317 bytes
Ciao, Gattuso!
hai scritto 421b0a50$0$6307$5fc30a8@news.tiscali.it
Tue, 22 Feb 2005 11:33:08 +0100:

 >Vorrei sapere se in visual basic 6 esiste  una funzione
 >che mi permette di richiamare in automatico una finestra di scelta file,


 >Esempio:

 >Dim szFile as string

 >szFile = BoxSelectFile("c:\temp\",*.cnc)<<< "*.cnc" !!!


 >Qualcosa del genere dove in szFile mi venga ritornato il nome del file selezionato.

con un poco di fantasia....

aggiungi un *controllo commondialog* sul form
copia la nuova(?!?) funzione BoxSelectFile
nel codice del form

'
private function BoxSelectFile(spath$, sestensione$) as string
on error goto gesterr
dim retf$

with commondialog
    .filename=""
    .initdir=spath
    .filter="file ("& sestensione &")|" & sestensione
    .flags=cdlofnfilemustexist or cdlofnhidereadonly
    .cancelerror=true
    .showopen
    retf=.filename
    '.filetitle contiene solo il nome del file, senza percorso
end witj

gesterr:
'se e' stato scelto annulla o altro err, la function restituisce ""
err.clear
BoxSelectFile=retf
end function
'

 >Ciao e Grazie

p.s.
non giochi piu' a pallone? :)

Cordialita', ~Incoming. 
Technical Details
Message-ID: <421d0270$0$32352$5fc30a8@news.tiscali.it>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news1.google.com!proxad.net!212.101.4.254.MISMATCH!solnet.ch!solnet.ch!news-zh.switch.ch!irazu.switch.ch!switch.ch!newsmi-eu.news.garr.it!newsmi-us.news.garr.it!NewsITBone-GARR!newsfeed.cineca.it!draco.tiscalinet.it!news-f1.tiscali.it!not-for-mail
References: <421b0a50$0$6307$5fc30a8@news.tiscali.it>

Show Full Headers
Complete Article Headers
X-Google-Thread: f94ee,8766bb09b8c73530
X-Google-Attributes: gidf94ee,public
X-Google-Language: ITALIAN,ASCII-7-bit
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news1.google.com!proxad.net!212.101.4.254.MISMATCH!solnet.ch!solnet.ch!news-zh.switch.ch!irazu.switch.ch!switch.ch!newsmi-eu.news.garr.it!newsmi-us.news.garr.it!NewsITBone-GARR!newsfeed.cineca.it!draco.tiscalinet.it!news-f1.tiscali.it!not-for-mail
From: "~Incoming" <speriamo.che.me.l@cavo.it>
Newsgroups: free.it.visual-basic
References: <421b0a50$0$6307$5fc30a8@news.tiscali.it>
Subject: Re: Box Select File
Date: Wed, 23 Feb 2005 14:35:09 +0100
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
FL-Build: Fidolook 2002 (SL) 6.0.2800.86 - 14/6/2003 22:16:25
X-Comment-To: Gattuso
Lines: 54
Message-ID: <421d0270$0$32352$5fc30a8@news.tiscali.it>
Organization: Tiscali SpA
NNTP-Posting-Host: 62.11.115.147
X-Trace: 1109197425 news.tiscali.it 32352 62.11.115.147:1088
X-Complaints-To: abuse@tiscali.it