Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Load Combo Items From An Ini?


Hi,

I'm not sure if I'm posting this in the right place

I'm already using an ini to save the settings in my application, so is it possible to use the ini file to load my combo box items?

Maybe the KeySection could be called COMBO and then list the items... I'm not sure how to do this, or even if it's possible.

Could anyone tell me if it's possible, and if so how?

Thanks a lot, much appreciated!




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Load Combo Box Items Once
I've got a list of around 5000 share codes that I display in a combo box which the user selects 1. As there are around 5000 items to add it takes 3/4 seconds for them all to load and it looks like my app has frozen...

My question...is it possible to load all the items into a combobox when my app loads (I have a splash screen) and then display that combo box which already has the share codes added when I load any form that needs to display the list?

Hope that makes sence.

Load Combo Items From Access Db
hi
i have aform in visual basic with acombo box on it
now this is what i want to do but i dont know how

i want the combo box to get items from atable in an access database when the form loads

say instead of the combo1.additem "blabla"

i want this to happen by collecting them from a one field table in access

thanks

Clear Combo Box And Load New Items
Hi,

I have a combo box to which I've added 50 items. At one point, I clear these out and replace with a different set of items. I am able to do this except that when I click the combo box, there is always a blank space first and the new items follow.
How can I get rid of the blank space?

Thanks for your help.

Dynamically Load Menu Items
Hi to all.

I want to load some menu items from the code.
I have already (for example) 3 main menus:

Server1
Server2
Server3

Can I add sub-menus to those main menus? like this:

Server1
---SubMenu1
Server2
---SubMenu2
Server3
---Submenu3
---SubMenu3a
------ExtraSubMenu4

and another question: what does exatcly the property "parent" of an object??

thanks

simons

How To Add Menu Items At Form Load
If i had a text file with a list of things i wanted in my menu, is it possible to add to the menu like that? So far i've only used the menu editor, is there a way to edit the menu when the program is run?

So for example, say at the top i have:

Code:
File Edit Trustees Lenders Exit
Now, i just want to add things under the "Lenders" menu.

Is It Possible To Save/load Items From/to A Listbox.
What I want to do is be able to take a bunch of items from a list box and save it as a .txt file. So say I have,
"Item 1"
"Item 2"
"Item 3"
I want to hit a "save" button and have the list be saved to a .txt file.

I also would like to be able to load a bunch of items from a .txt into my list box. So say, my list is clear and If i click a "load" button that will load a bunch of info from a .txt file.

Is this possible to do in Visual Basic 6? I know that this is possible with a text box but I would like to do this using a list box.
Thanks

Load/Get First 10 Items In File List Box
hey all,

Does anyone know how i can get the first 10 items of a file list box?
Just noice and simple for starters like put each into a message box or something!

For example:

I do a file1.listcount to get the amount of files in the box.
Now i want to be able to load the first 10 items then the user can press a button to load the next 10 items and onward until the end?

Anyone?

Load Startup Items Into Treeview
Hello,

I am making a registry edit program and i have a treeview control. At the moment the treeview says.....

Sample Node
      Sample Node
      Sample Node
Sample Node

How do i change these to say other things?

Any help is great

- Chris




Edited by - chrisgill369 on 5/15/2004 12:16:23 PM

Disable Menu Items On Form Load
The command buttons are enable and working fine. But Menu items (sub items) are not grayed out. Please suggest.

Thanks


Code:
Private Sub Form_Load()

Dim dbMyDB As Database
Dim rsMyRS As Recordset
Dim sSQL As String

Set dbMyDB = OpenDatabase("k:Plan_ManagerDataBank2k3_4.mdb")
sSQL = "SELECT DISTINCTROW ID, GM, PM, TT, CC FROM tblInstall WHERE ID= '" & Environ("USERNAME") & "';"

Set rsMyRS = dbMyDB.OpenRecordset(sSQL, dbOpenDynaset)

Do While Not rsMyRS.EOF
ListUserID.AddItem rsMyRS(0) & " " & rsMyRS(1) & " " & rsMyRS(2) & " " & rsMyRS(3) & " " & rsMyRS(4)
'rsMyRS.MoveFirst
If rsMyRS(1) = True Then
cmdInstallGM.Enabled = 1
Else
MnuInstallGM.Enabled = 0
End If

If rsMyRS(2) = True Then
cmdInstallPM.Enabled = 1
Else
MnuInstallPM.Enabled = 0
End If

rsMyRS.MoveNext
Loop

End Sub

Adding Items To List Box At Form Load
I'm using a listbox to keep a running list of text already entered. Everytime the form is closed, i have a file that updates itself to include all strings entered. I want to re-load these strings into the list everytime the form opens. However, the strings dont reload. They do save into the file though.
Any help would be greatly appreciated!

Save/load Checked Treeview Items
hello i am not very familiar with the treeview control, but what is an easy method of saving all the checked items in a treeview on unload and loading the checked items on start up.

thanks for your time and i look forward to your reply.

How To Load Listview Items In Browser On Double Click?
Hi all could any one show me how i can load a selected listview item and it loades in a browser by double clicking .Thanks

Anyone Wanna Tell Me How To Load/save Items From A Listview To A File? Plzzzzzzzzzzzz
Anyone wanna tell me how to load/save items from a listview to a file? plzzzzzzzzzzzz

Combo Box Add Items
I use database. I have field name "username". It contains 3 records "User1","user2" and "user3" .

I don't want "user3" were added into combo box. How I can do that?
I use code below but it add 3 user into the combo box.


Code:
adoRS.Open "SELECT * FROM pass order by id", adoConn, adOpenDynamic, adLockOptimistic
Do Until adoRS.EOF
Changepass.Combo1.AddItem adoRS.Fields("username").Value
adoRS.MoveNext
Loop

Items In A Combo Box
ok so basically heres my problem

i have an empty text box, text1.text

and a combo box

when u click the combo box it will drop down^
1
2
3
4
5
and when you click 1 i want it to appear in the text box saying:
"you have just clicked 1"

and if you click 2 i want it to say:

"you have just clicked 2"

but i dont no what the code is for actions in a combo box.

can some1 please help me!



dunno if i explained this very good:S

How To ADD ITEMS To COMBO BOX...
Hello there, VB Experts! Now I have some serious tough questions here...

How do you READ values from a file then add it into a combo box?
For EXAMPLE a file called "fonts.cmd" the value:
Arial
Fatity

Tahoma
Reci

Suicide

------------------ As you see there are spaces between the values, how do I put those values into a COMBO BOX? So, I can select the values in the COMBO BOX.



And what does vbCrLf do?
How do I use vbCrLf?

How To Add Items In Combo Box
Okay, the Title isn't specific enough but I will specify myself here.

I am making this program (well I already made it... Finished) Anyways It has a Combo box with all content and stuff, then when you click on it it will bring up texts and stuff in a text box! What I'm wondering is, if you save a File that you have edited in that txtBox(textbox) and add that file in the cboBox(combobox) so when the user clicks on that cbobox the content of that file appears in the text box. I know the Command cboBox.Additem (Whatever) but you see, when you unload the Program, that item will be gone.... and forever lost, I want it to be there permanently, forever...... How can I do this, Can anyone show me an example code?

Thanxx!

Combo Box Items
I am a VB newb and need some help.

I am just trying to create a few simple combo boxes that just show a list of data that will not change.
Over time the results selected I may use to execute other things but for now they are just for visual representation.

The code I have started works fine, but everytime I click the pull down box it keeps adding the same items over and over!!!
I want to avoid using a form and just leave it embeded withing Excel.

My code:
Private Sub Box1_change()
box1.AddItem "None"
box1.AddItem "Tx on Selected"
End Sub

Thanks

Combo Box Items
Hi everyone... I have a form on which I placed a combo box. I have coded my form so that if my user starts typing their name into the combo box's text area, it auto completes. If I have Joe and Joanne both in my list, and my user starts typing "Jo, the auto complete feature will have selected Joanne, but the next character typed is "s" (name is Joseph), how do I compare the text value with the items in the list? I thought Combo1.Item, but Item is not an available property for a combo box. So what would it be?
Code:If NOT Combo1.Text = Combo1.??? then

Happieman
a.k.a. Bill

Edited by - Happieman on 10/31/2007 12:50:28 AM

Deleting Items From A Combo Box
Hi everyone, I'm pretty new to VBA so this might be silly. I have a combo box that is unbound. I add the items by reading the subdirectories in my app directory, so I'm using cbo.AddItem, how do I delete them so when I add them again I don't have repeated values? I'm used to using cbo.Clear in VB, but I don't have that property in VBA.
Thanks!

Adding Items Into A Combo Box With For/Next
Newbie problem, any help is greatly appreciated!!!

Here's what I have. I am writing a program that maintains reports for the volunteer firestation in my town. Each "User" of this program has their data stored in it's own file. (IE: If the UserID was 201 then their profile path is "App.path & "datauserinfo" & UserID & ".pfd"" making in my case the path: c:pauldenvfduserinfo201.pfd).

I am trying to use a for next loop (XasRadioLoads) to open these files one by one to get that data from them to fill in a combobox. I only have 2 users of a possible 20 configured at this point. What the loop is doing is adding 10 each of my 2 users filling up 20 spaces instead of just 2. Here is the code I am using.
---------------

On Error Resume Next
UserToVerify = 201

For XasRadioLoads = 1 To 20
Open App.Path & "datauserinfo" & UserToVerify & ".pfd" For Input As #1
Input #1, UserRadioID, UserLastName, UserFirstName, UserMI, UserAddress, UserCity, UserState, UserZIP, UserPhone, UserCellPager, UserGrantAccess, UserPassword
Close #1

combo_IC.AddItem UserRadioID & " - " & UserLastName & ", " & UserFirstName
combo_IC.Refresh
UserToVerify = UserToVerify + 1
Next XasRadioLoads

--------------------

Can anyone help me with this? THANKS A LOT!!!

Dynamic Combo Items
hi,

I need to load combo box values dynamically from a external text file

The external text file will contain 2 pieces of information DisplayName & Path seperated by a tab

App1 C:TestApp1.exe
App2 C: est2App2.exe and so on

I am trying to build a small interface that has a combo box and a Launch App button. The combo box will contain all the Diaplay Names from the external textfile and when the launch App button is clicked i use shell and call the relevant path of that combo item.

Can someone give me an idea of how this can be done?.

Removing All The Items In Combo
Hello
I added values from 1 to 50 to combo:

For x = 1 to 50

Combo.AddItem x

Next x


But when an event is triggered I want to remove these values:

For x = 1 to 50

Combo.RemoveItem x

Next x

This does not work, how should I remove all the values?

Duplicate Items In A Combo Box
Hi,

I have a combo box for which I am adding items to the drop down list with the .additem property.
I am adding items during the running of the application by the user. However, duplicate entries are being added to the combo box if a user selects one of the list items a second or more times.
Does anyone know if there is a way or maybe some code that can stop duplicate entries appearing in the drop down list.

Tanx,
Trigg.

How To Only Add Unique Items To A Combo Box.
Im making an Internet Explorer knock-off for my programming class. I am using a combobox for the address bar, so I can add sites visited into it. I only want to add unique addresses though. As of now, it adds the same addresses several times.

Any help?

Disable Combo Box Items
Is it possible to disable individual items in a combo box, if not is it possible to change the forecolor of individual items so as I can disable them through code?
Thanks for any help

Remove Combo Items
i need to remove items in a combo box that already exist in the list but im not sure how. i thought this code i wrote last night would work, but it doesnt, and i cant figure out why. any ideas?



Code:
For b = 1 To cboRecent.ListCount
'c is the array index
c = b - 1
'd is a value linked to c array index
d = cboRecent.List(c)
'nested for to find a match between d & the other items
For e = 1 To cboRecent.ListCount
f = e - 1
If cboRecent.List(f) <> d Then
'add item to list
cboRecent.AddItem (RECENTLIST)
End If
Next e
Next b

COMBO: Selecting Items
the combo is populated with


Code:
cmbWC.AddItem Format(refWC.wc & " " & refWC.desc, "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@")

where refwc.wc is up to 6 characters and refwc.desc is up to 20 chars.

and i want to be able to have an item selected based on refwc.wc.

help.

Assigning To Items In A Combo Box
I have a combo box in my new program, never used one before, but I managed to put 4 items into a list

each item needs a value though, heres an example of what I got:

combo1
Item1
Item2
Item3
Item4

each item in it needs a value as I said, how do I go about getting them in?

Duplicate Items In A Combo Box
I have created a quotes data base wherein i collect data from books, articles, and even articles on the internet. I use 6 different comboboxes, combobox(0) to combobox(5), to fill in the title, author, and keywords. So each time i move from one record to another or add records, i call the following procedure, so as to rewrite each of the text, combo, and richtext boxes on the form. This procedure is called "PopulateRs"

Public Sub PopulateRs(Rs As Recordset, ctlControl As Control, cntIndex As Integer)

Rs.MoveLast
Rs.MoveFirst
Do While Not Rs.EOF
Select Case cntIndex
Case 0
combobox(cntIndex).AddItem Rs!bkart_
Case 1
combobox(cntIndex).AddItem Rs!author
Case 2
combobox(cntIndex).AddItem Rs!ISBN
Case 3
combobox(cntIndex).AddItem Rs!keyword_1
Case 4
combobox(cntIndex).AddItem Rs!keyword_2
Case 5
combobox(cntIndex).AddItem Rs!keyword_3

End Select
Rs.MoveNext
Loop

End Sub


The problem that i am encountering is that i get duplicate items. If for example, i enter the author name of "Lee, Dorothy", the first time this is no problem. The second time when i choose this name from the list, it is duplicated in the list of items. What should i do to correct this problem of duplicate entries?

persub

Switching Items In Combo Box
Good Afternoon All.
I am trying to code a "Select" function in my application that will allow the user to select items by Product ID or by Product Description.
The main form has a combo box set up that currently displays the Product description Information.
I am struggling to work out how to code my menu items "Select > by Product ID" so that it changes this combo box to display the Prodict ID's from the tbl, and also fill the text boxes with the appropriate information.
"Select > by Product Description" should change the combo box to display the product description info etc.

I have attached the current project so that hopefully seeing how I currently have everything set up will make it easier for you to assist me.
I am working in Visual Studio 2005.

Many Many thanks in advance.

Edit by Shurik12:
Please no binaries in attachments

Adding Items To Combo
Is there a way where I can read from a file and add each line of the file to a combo control?

Duplicate Items In Combo Box
hello .. i have a combo box that is load from a database field. what i want to do is when i select an item to display a description in a textbox.. It displays what i want to display fine, but everytime i click on the combo box to selected an item it duplicates the item. I tried the change event but doesn't display anything in the textbox..

Private Sub cboPrice_Click()

If Me.cboPrice.ListIndex = 0 Then
Call showPrice(Me, 1)
Else
Call showPrice(Me, 2)
End If


End Sub

thanx

Loading Items Into A Combo Box From TXT
Hey,
I have a combo box, also have a txt file containing a username and other data, I want to load the first value (delimited by "~") into the compbo box.
the first bit of data will be the username...
I know how to open and read the file, but not how to get the first value into the combo box in a list form
and then when something from the list is selected but the corresponding data into the fields. Hope that makes sence, If you could point me in the right direction that would be great!
Thanks

Need=&gt;comparing Items From Combo Box
sample codes could be a great help..tnx

Combo Box...disabling Items
is there a way i can disable items in a combo box once they have been selected.
I know you can remove them but this messes with the listindex values?

i had been removing them all along but it wont work as it changes the value of the string im assigning to it.

heres what i had:
If cboLocation.ListIndex = 0 Then
stLocation = "GCS1"
cboLocation.RemoveItem (itemIndex)
ElseIf cboLocation.ListIndex = 1 Then
stLocation = "GCS2"
cboLocation.RemoveItem (itemIndex)
ElseIf cboLocation.ListIndex = 2 Then
stLocation = "GCS3"
cboLocation.RemoveItem (itemIndex)
ElseIf cboLocation.ListIndex = 3 Then
stLocation = "GCS4"
cboLocation.RemoveItem (itemIndex)
ElseIf cboLocation.ListIndex = 4 Then
stLocation = "GCS5"
cboLocation.RemoveItem (itemIndex)

etc etc

Adding Items To Combo Box
Hi,

are there any way (code or other special control) which makes the Combo box control able to add new items during Runtime if this item is not in the combo box list, complete the text if the first letters typed in the combo Box are included in one of the list and so on ...
may any code can do it.... pleaase prode me with the code.

Thanx

Adding Items To Combo
How would I insert more text into the combo, that way when i click the / button, it'll have more choices instead of just the header

Can Items Within A Combo Box Expand?
Good afternoon!

I'm making a fairly simple database with Access 97 and VB6. One of the combo boxes in the database lets you select an e-mail program from a list. Right now I have

"Outlook"
"Outlook Express"
"Netscape Mail"
etc

What I would like to be able to do though, is when I put my mouse on "Outlook", for example, then a new menu opens up right next to it with a list of versions to choose from. So it would be like

"Outlook" -> "97"
"2000"
"2002"

etc.

Things like that are easy to do with the Menu Editor, but can a simple combo box expand like that? or would I have to make my own activex control?

here's an example of what I mean by an expanding menu. ^_^



thanks!

How Can I Sort Items In Combo Box
I Would like to display the items sorted i.e whenever I press any key it will bring the items matching the letter.
I mean it will work as index of MSDN help.

I need urgent help

Add Items To Combo Box In Word Doc
I am setting up a template for staff to use & find that the basic word forms combo boxes are too limited, so I am trying to learn how to add an ActiveX combo box instead. I know how to go into Word 2000, drag a combo box from the control toolbar onto the template where I want it to be located & then go into the coding area - but I am not finding the right code to add items so that they list correctly. After the sub combobox1_change() line I use the additem method, but find that if I don't add the right items the first time, the list either repeats or holds old values when I go in to change items later or keeps adding values as they are selected each time.... There are about 5 fields out of about 25 that I need these combo boxes for on the template, the rest can just be filled in by the worker. I am not using a userform, just adding the box to the template - is there a better way to try to do this?

How To Save Items In A Combo Box
Alright, here is my predicamint... I have a a combo box, and i want to save items to a file. Lets say it has 4 itmems in it, but it could have more or less at any given time... (the combo box name is cmbgoods)

Here is how the save so far is set up:


VB Code:
Private Sub mnuSave_Click()' this routine saves the game to disk. ' set up the CommDialog controlOptions.CommonDialog1.DialogTitle = "Save Game As" Options.CommonDialog1.FileName = "SaveGame.tsv" Options.CommonDialog1.DefaultExt = "tsv" Options.CommonDialog1.Filter = "Saved Games (*.tsv)|*.tsv|All Files (*.*)|*.*" Options.CommonDialog1.ShowSave  lFileName$ = Options.CommonDialog1.FileName If InStr(lFileName$, "") = 0 Then Exit Sub  Open lFileName$ For Output As #1' output a headerWrite #1, Char.Name & " Saved Game"' write out the character statsWrite #1, Char.Name' write out the itmesWrite #1, 'What goes he so it would save all the items in the combo box End Sub


If you need any other info that would help you out, just reply. Thx

~$uper-$tar

Adding Items To Combo
I would like to add some items in a combo box
I have the list in a string
E.G.

mystring ="a|b|c|d"

each item separated by "|"

Is there a way using a single call to a method in combo I can add this string to combo rather than calling addItem method in a for loop . This is because I have a lot of items to be added and it takes a considerable amount of time to loop through and add each items.

Currently I am using this method
Dim arrValue
arrValue = split(mystring,"|)
For intIdx = 0 To UBound(arrValue )
cmbValue.AddItem arrValue(intIdx)
next

But cmbValue.AddItem (mystring ) doesnt work.

Thanks in advance

Make Some Of The Items Look Different In A Combo Box
Hi friends,
I have a combo box called LstSalesReps.
I have five items in it
1)Allan
2)Steve
3)John
4)Dave
5)Tim

The SalesReps Dave and Tim are not active now but i do NOT want to remove them from the combo box.
I want to show the SalesReps Dave and Tim in different color or different font or anything of that sort which differentiates Dave and Tim from the rest of them in the combo box.
Hope you understand my question.
Please reply soon.
Thanks,
Srini

Bold Items In A Combo Box
Hey,
I know it's possible to make all the items in a combo box bold, but is it possible to make only some as bold?

thanx

Adding Items To Combo Box
Hai
             I'm doing a simple proj. in that i wish to add items to combo box at runtime.
when i'm typing an item into the text area of the combobox at runtime and pressing add button, it was accepting that new item. The problem is when I closed that form or project, the new items i entered are no more visible in the combo box.
    Plz help me.
            kiran chand

How To Disable Certain Items Of Combo Box In Vb?
Sometimes, based on requirements from users, we like to disable certain items of combo box. It seems VB doesn't provide support for such thing directly. How can I do that? Thanks for your inputs.

Copyright © 2005-08 www.BigResource.com, All rights reserved