nazivi foldera u combobox

nazivi foldera u combobox

offline
  • Pridružio: 26 Okt 2008
  • Poruke: 1560
  • Gde živiš: Sremski Mihaljevci

Ljudi ubi me jedan problem.
imam jedan folder pod nazivom,, a". U tom folderu mi se nalaze 3 foldera a,b i c. E, sad, kako da izvedem da mi se u comboboxu pojave itemsi sa nazivom ta 3 foldera, a,b i c??



Registruj se da bi učestvovao u diskusiji. Registrovanim korisnicima se NE prikazuju reklame unutar poruka.
offline
  • Pridružio: 28 Jun 2004
  • Poruke: 990
  • Gde živiš: Kucura

Jel znas kako da ocitas subfoldere u nekom folderu? Ako si resio taj problem, ne bi trebalo biti problem ubaciti te podatke u combobox Smile



offline
  • Pridružio: 26 Okt 2008
  • Poruke: 1560
  • Gde živiš: Sremski Mihaljevci

pa znam da ubacim ali kako da ocitam?

offline
  • Pridružio: 28 Jun 2004
  • Poruke: 990
  • Gde živiš: Kucura

Pa imas Google Smile
Nemoj da te mrzi da trazis... A nemoj ni traziti od nas da ti mi trazimo, ok? Ako imas pravi problem, mozemo ga resiti (ako i mi znamo), ali ovo nije problem.. ovo je lenjost Confused

offline
  • Pridružio: 26 Okt 2008
  • Poruke: 1560
  • Gde živiš: Sremski Mihaljevci

Napisano: 07 Jun 2009 22:17

hvala. nisi trebao......

Dopuna: 09 Jun 2009 22:11

Hoce li mi iko pomoci???

offline
  • Pridružio: 06 Maj 2007
  • Poruke: 241
  • Gde živiš: Beograd

Ne razumem, zasto niko nece da ti da kod u VB6. Pa to je toliko lako. Pa imas primer za komandu dir, samo sam malo prepravio kod i dodao kod za combo box.

Evo:
Private Sub Form_Load()     Dim MyFile, MyPath, MyName     ' Returns "WIN.INI"  if it exists.     MyFile = Dir("C:\WINDOWS\WIN.INI")         ' Returns filename with specified extension. If more than one *.ini     ' file exists, the first file found is returned.     MyFile = Dir("C:\WINDOWS\*.INI")         ' Call Dir again without arguments to return the next *.INI file in the     ' same directory.     MyFile = Dir         ' Return first *.TXT file with a set hidden attribute.     MyFile = Dir("*.TXT", vbHidden)         ' Display the names in C:\ that represent directories.     MyPath = "c:\"   ' Set the path.     MyName = Dir(MyPath, vbDirectory)   ' Retrieve the first entry.     Do While MyName <> ""   ' Start the loop.        ' Ignore the current directory and the encompassing directory.        If MyName <> "." And MyName <> ".." Then           ' Use bitwise comparison to make sure MyName is a directory.           If (GetAttr(MyPath & MyName) And vbDirectory) = vbDirectory Then              'Print MyName   ' Display entry only if it              Combo1.AddItem MyName                         End If   ' it represents a directory.        End If        MyName = Dir   ' Get next entry.     Loop         'Prikazi prvu stavku     Combo1.ListIndex = 0         'Prikazi Poslednju stavku     'Combo1.ListIndex = Combo1.ListCount - 1 End Sub

https://www.mycity.rs/must-login.png
[/code]

offline
  • Pridružio: 26 Okt 2008
  • Poruke: 1560
  • Gde živiš: Sremski Mihaljevci

to radi. hvala. samo ne znam sta znace i zasta sluze ove linije coda:

'Prikazi prvu stavku
Combo1.ListIndex = 0

'Prikazi Poslednju stavku
'Combo1.ListIndex = Combo1.ListCount - 1

nemam svojstvo listindex i listcount pa sam to izbrisao ali radi

offline
  • Pridružio: 06 Maj 2007
  • Poruke: 241
  • Gde živiš: Beograd

Pa koji ti visual basic koristis?
Ovo je kod za VB6.
Evo objasnjenej iz helpa:


ListIndex Property

Returns or sets theindex of the currently selected item in the control. Not available atdesign time.

Syntax

object.ListIndex [= index]

The ListIndex property syntax has these parts:

Part Description
object Anobject expression that evaluates to an object in the Applies To list.
index Anumeric expression specifying the index of the current item, as described in Settings.


Settings

The settings for index are:

Setting Description
–1 (Default for ComboBox, DirListBox, and DriveListBox controls) Indicates no item is currently selected. For a ComboBox control, indicates the user has entered new text into the text box portion. For a DirListBox control, indicates theindex of the currentpath. For a DriveListBox control, indicates the index of the current drive when the control is created atrun time.
n (Default for FileListBox and ListBox controls) A number indicating the index of the currently selected item.


Remarks

The expression List(List1.ListIndex) returns the string for the currently selected item.

The first item in the list is ListIndex = 0, and ListCount is always one more than the largest ListIndex value.

For a control in which users can make multiple selections, this property's behavior depends on the number of items selected. If only one item is selected, ListIndex returns the index of that item. In a multiple selection, ListIndex returns the index of the item contained within the focus rectangle, whether or not that item is actually selected.

offline
  • Pridružio: 26 Okt 2008
  • Poruke: 1560
  • Gde živiš: Sremski Mihaljevci

Napisano: 11 Jun 2009 19:40

koristim 2008. radi code i bez ova dva poslednja reda, cetiri i sa ovim kada kucas ' pre pocetka svakog reda...

Dopuna: 12 Jun 2009 22:32

ideja je uspela. hvala...

Ko je trenutno na forumu
 

Ukupno su 875 korisnika na forumu :: 48 registrovanih, 5 sakrivenih i 822 gosta   ::   [ Administrator ] [ Supermoderator ] [ Moderator ] :: Detaljnije

Najviše korisnika na forumu ikad bilo je 3466 - dana 01 Jun 2021 17:07

Korisnici koji su trenutno na forumu:
Korisnici trenutno na forumu: anta, bankulen, bojank, cikadeda, dankisha, darionis, darkangel, Dimitrije Paunovic, Dimitrise93, DonRumataEstorski, Dovla, drimer, dushan, Georgius, hyla, Ilija Cvorovic, Ivica1102, Krvava Devetka, Kubovac, laurusri, Lošmi, MB120mm, mercedesamg, Metanoja, milenko crazy north, MiroslavD, mocnijogurt, mrav pesadinac, Ne doznajem se u oružje, nemkea71, nikoladim, nuke92, pein, Pohovani_00, radoznao, rajkoplje, rodoljub, Romibrat, saputnik plavetnila, SR-3m, Srle993, stegonosa, vlajkox, zbazin, ZetaMan, zlaya011, šumar bk2, 79693