Listbox, Files Reg Entries, + Stuff.
Yo every1ok. i wanna make a prog that lets u view pictures. but i want 2 store all the pics names in a combo box. i want to b able 2 store the pictures file name inside a variable,the idea being that i can call the pictures variable number, eg 1, and the add .filename or .picturename or whatever, but im not sure how 2, or even if its possible. i also want 2 let ppl add new pics, and store the new pics names and file in the reg. any ideas?Ta.------------------jimmyICQ:35813919 firstname.lastname@example.org [This message has been edited by jimdalby (edited 01-13-2000).]
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Deleting Entries In Excel And Other Small Stuff
How do I delete an entry within Excel. Also, how can I make a word document appear from within VB. Lastly, how can I add the numbers of 4 text boxes, when I try to add 1,1,1,1 I get 1111, not 4. It seems like it should be very simple, but I can't do it. Any help would be greatly appreciated.
Reordering Listbox Entries
Is there an easy way to move listbox items up or down? I didn't find a way to change their index numbers. So the way I did it was by removing relevant items and re-adding them in the order I want. Is this how this is done? Or did I just reinvent the wheel? Please let me know.. any help is appreciated.
Listbox Update Of Entries
After entering a code a record value gets inserted into a listbox with a # behind it
How can i check if that value is already in the listbox?
I want it so when i enter the same code twice that number behind the value gets added +1
i tried the search function but didn't find it
Help With Selecting Certain Entries In The Listbox
I have a listbox that contains about 96 entries that I pull in from an oracle database. This list allows users to select columns that they want to display in the later steps. There are about 15 of those field names that are 'most popular' and will probably be selected most of the time...so I want to give them a way to click one button and automatically select those 15 entries. So, my question is, knowing those 15 entries, now can I automatically select those entries in the list box? What is the code for that. I tried to loop through all the entries, compare them to the 15 'default' and then use lb_fieldlist.Selected (i) = True (where i is the index), but it did not work.
Any help would be greatly appreciated.
Indexing Listbox Entries
how do I index entries into a listbox so that they can be added together, the entries are prices and i need to have a total box which is calculauted by adding the prices in the listbox together????
Removing First Entries In Listbox?
I was just wondering how to remove the first 6 entries in a ListBox a example would be:
Different Colours For Entries In A Listbox
I have written a small VB app that analyses our server logs files (this log file contains server logins and logouts).
My app returns results based (based on search patterns) to a list box.
I need to change one line of the listbox to green color (login) and other lines to red (logouts).
Problem is that I dont think listbox can handle different colors for different lines.
Am I wrong, can this be done using a listbox?.
If not, is there any other control that would allow me to do this?
Thanks in advance,
Disappearing Listbox Entries
My listbox wont hold any items! I jsut changed the code that loads items into it and now nothing is working. It runs every line of code like it should but nothing happens, all the variables are set correctly, I checked with breakpoints and message boxes. The code that actually puts it in the listbox is the same so it shouldn't be a problem.
My OLD code:
If Estimate.CompositeDesign = 1 Then Boxes = GetIniSetting(IniPath, "BoxTypes", "PGEBoxes") Else Boxes = GetIniSetting(IniPath, "BoxTypes", "SMUDBoxes") End If BoxTypes = Split(Boxes, "%") For i = 0 To UBound(BoxTypes) If BoxTypes(i) = "PB Pedes" Then BoxTypes(i) = "PB Pedestal" VType.AddItem BoxTypes(i) Next i
My NEW code:
Boxes = Split(LoadFile(AppPath & "Boxes.txt"), vbCrLf) If Estimate.CompositeDesign = 1 Then Boxes = Boxes(0) Else Boxes = Boxes(1) End If BoxTypes = Split(Boxes, "%") For i = 0 To UBound(BoxTypes) If BoxTypes(i) = "PB Pedes" Then BoxTypes(i) = "PB Pedestal" VType.AddItem BoxTypes(i) Next i
Why doesnt it work?!?!
Displaying Listbox Entries
Because of some screen requirements, I've had to resize some ListBoxes on the screen to the point where you can't see the entire entry. This stupid control doesn't have a horizontal scrollbar (why not?), so what can I do?
Listbox .. Entries .. Search
hy, how can i search a listbox .. to find a entry?
my prob is: i want make a entry .. but if the same is in the box ..
vb shouldn't create it!!
plz help ..
Height Of Listbox Entries
I've searched and read until I'm blue in the face and haven't made much progress. This post might belong in the API section, but I'm not sure. Anyway, can someone explain to me how I can get the height of all the items (sum total) in a listbox, be that 1 item or 15. I think this may be accomplished w/ LB_GETITEMHEIGHT and then multiply this by the index of the listbox but I can't make it work. Probably a dumb coding error, and my eyes are tired so I've probably overlooked it. Can someone _please_ point me down a fresh path?
Listbox Entries And Retrieving Them
I've been through the more documentation than I can shake a stick at and can't find the answer to this question:
I have a listbox with n entries. I need to be able to "walk" down the listbox entries and compare them against a specific value.
How do I sequentially retrieve the values from 0-(listcount-1)?
How Do I Sort Entries In A Listbox By Not Using The..
sorted property. In my listbox I have two entries, filename and filedate. I want the user to be able to click on filename or filedate and the contents of the listbox will be resorted depending on the button they click on.
Check Listbox Entries
Can anyone tell me how I can check to see if a listbox entry is already present?
Say the listbox already contains
and I get a result (say Apples) that I want to add to the list box. I do not want Apples to appear twice.
I thought a simple function that checks the current list is all that would be required but I cannot seem to figure out how to do it.
Any help would be appreciated.
What Is The Limit For ListBox Entries?
Hello, I just came across a problem with one of my apps that is leading me to believe that there is a limit to the number of entries I can add to my a file of zip listbox. I read codes into my listbox to sort and dedupe them, but it seems the value cannot be greater than the value of an integer? After the Listcount went ove 32k then the listcount became a negative value.
Is there a way to change the the values that a listbox can hold?
Remove Duplicate Listbox Entries
I have searched but cannot find anything that works
I am wanting to remove any duplicate text from the list box....
heres an example of my code (does not work)
Private Sub Command8_Click()
Dim itext As String
For i = 0 To List1.ListCount - 1
itext = List1.List(i)
If List1.List(i) = List1.List(i) Then
MsgBox "2x song", , "ERROR"
All help much appreciated!
Limiting The Amount Of Entries In A Listbox
Right i have a listbox and i am simply adding data to it
I just need to limit the amount of enteries i can put in this listbox and then if possbile when it gets to this amount of entries disable my command1 button so you cantcrash the program by trying to add more
Scroll Bar At Bottom Of Listbox Entries
I have a ListBox that contains six entries. The entries are only 3 characters in length, e.g. "340", "405'. etc.
When I show my ListBox there is a horizontal Scroll Bar at the bottom of the box. What ListBox property do I need to adjust on my form to eliminate the scroll bar?
Savind ListBox And ComboBox Entries
Is there a trick to saving contents of a ListBox and Combo to ONE Access Database Table field ?
I have a list of 10 people in a combobox.
When I save to the table, all names are concatenated as a string.
When I restore the comboxbox from the table data, I get 1 record.
Am thinking of delimiting them with commas and mid$ etc. but was wondering if someone had a sample ?
Maximum Numbers Of Entries In ListBox
What is the maximum number of entries that I can add to a listbox? And what does VB do if I keep adding and exceed maximum number of entries?
Well - ListBox Entries To A Single String
I am attempting to create a single string from all entries in a listbox. I know this can be done in a for loop, but was wondering if there is a faster way of doing it?
Basically I am looking to do this :
and create a string like this
TEST1; TEST2; TEST3
Is there a simplier way of accomplishing?
Saving ListBox Entries To A Txt File
Haven't coded in Visual Basic for a while, nor was I very good at it. [and Nor does my Visual Basic have a Help File considering it was a burned copy from a friend.] Having said that I have got a file list box to read a .txt file in a list. ex:
the txt file:
well yeah you get the point.
It works and all now I have another drop down box which is used to add entries to the listbox, now How would I save the *NEW* listbox entries into the .txt file?
-btw i bet i'm doing this whole thing wrong, but i have a listbox with item names in it, i have it so when you select the item and press an "add button" it add's the itemname into the list box thus creating a 'database' type. I should probablly just make a database, but i suck at those, and i'm just expermenting.
How To Prevent Duplicate Entries Into Listbox...
I have a situation like this.I have a combo box in which say there are 4 entries.Say String1,String2,String3,String4.
Now i have a list box too.When i select a particular combo item then it should show in listbox.For Example:If i select String2 from combobox then String2 should be shown in listbox.
But there should not be any duplicate entries.Means String2 should not be shown more than once in listbox.Just give message box saying Duplicate entries not allowed if the users tries for that.
Can anyone help me giving suggestions.
Importing Listbox Entries Into Database
I'm making a little program using a database with products. This products can be selected, and will be put in a listbox. In this order:
ProductNr Productname Numberofproducts Totalprice
Now I want all the listbox entry's added into a database in a table called Orderedproducts with this 4 value's.. When there are 4 products in the list, it has to add 4 line's.. when there are 5 products, 5 lines, etc.. what is the easiest method to make this work? (please as easy as possible, because im pretty new and want to understand it, not just c/p it if possible with explanation.. thanks in advance for the help!
Multiple Line ListBox Entries
I was wondering if it is possible to have ListBox entries that take up more than one line, and if so, what would be the easiest way to do this. Any suggestions would be appreciated!
Preventing Duplicate Entries In A Listbox
I am filling a list box with the values of a certain field out of a recordset. This value, a company's name, may appear multiple times in the recordset but, I want it listed only once in the listbox. Right now, it loads as many times as it is found in the recordset.
Here is how I load the listbox:
'load the Company listbox
Do Until adoCompany.EOF
How can I prevent it from loading the same value in the listbox multiple times? I should think there is some way to iterate through the listbox's contents but just can't figure it out.
Sorted Listbox Maximum Entries????
How many elements can a listbox (which has the sorted property = True) hold before there is a noticeable delay in sorting?
I am deciding whether I should use a sorted listbox to maintain the sort for me for 50000+ elements, but I am worried whether "adding" items into a listbox (which is already heavily populated) will cause noticeable delays due to the required sorting logic which will be performed.
** Of course, I will always set the Enabled and Visible properties to False to increase the speed.
Edited by - uncletr on 8/9/2004 7:56:08 AM
Listbox And Textbox. Remove Duplicate Entries
I have a form that has a textbox and a listbox. These are filled dynamically from user input. I need to be able to look at each item the listbox and determin if it exits anywhere in the textbox (This textbox has multipul entries). And if it does, I need to remove it from the textbox. I do not want to clear the textbox, just remove the duplicated item.
Any Ideas how to do this?
Show ToolTipText Inside Listbox On Long Entries
Ok this is still bugging me after 6,7 months of searching on off I still never came accross a code that would do this for a Listbox
while your form's SCALEMODE IS SET TO PIXEL!!!!!!. I find tones of code that will work if ScaleMode is Twip but alas nothing for Pixel.
Here's what I got:
Option ExplicitPrivate Const LB_ITEMFROMPOINT = &H1A9Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Integer, ByVal wParam As Integer, lParam As Any) As Long Private Sub List1_MouseMove(Button As Integer, Shift As Integer, x As Single, Y As Single) Dim lXPoint As LongDim lYPoint As LongDim lIndex As Long If Button = 0 Then ' if no button was pressed lXPoint = (x) / Screen.TwipsPerPixelX lYPoint = (Y) / Screen.TwipsPerPixelY With List1 ' get selected item from list lIndex = SendMessage(.hWnd, LB_ITEMFROMPOINT, 0, ByVal ((lYPoint * 65536) + lXPoint)) ' show tip or clear last one If (lIndex >= 0) And (lIndex <= .ListCount) Then .ToolTipText = .List(lIndex) Else .ToolTipText = "" End If End With '(List1) End If '(button=0) End Sub
Just a basic question here because its been bugging me. Its not of major importance but I've always liked things to look nice.
As I search a record (which has been put into a list using list1.additem) I would like the result to come up selected in the list (as it does when you click on a row)
At the moment I just have the results coming up in msgbox's but if there was a way I would really like them to select the record that is searched for (oh and on a side note is there a way to put scroll bars on a listbox?)
hi, just need some help with listboxes.
1) I want to know how i can 'sort' the items in a listbox (A-z, Z-a) by clicking on a command button. But if i put say listbox1.sorted = true, i get an error, is there another way i can do it.
2) I need to put lots of info in a listbox, but theres so much horizontally, that it takes up more than the whole screen, is it possible to have some sort of scroll bar to scroll the listbox horizontally?
I'm making a multiuser chat/game, and have everything done except a userlist.. I have it semi-working, but I have a few problems.. I'm adding the names to the server listbox just fine, but when it comes time to remove them, I run into problems. It always removes the first name in the list no matter what.. here's my code:
Private Sub removefromlist(name As String)
On Error GoTo woops
For num = 0 To 30
listnames(num) = name
If listnames(num) <> "" Then
My other problem involves sending the list to the client, but I think I can get that working if I fix this problem.
For an assignment I've got to get the weight and add-up the length, breadth, and height of a parcel and put them all in a listbox. I've got to have running total of all the weight of the parcels that are in the listbox.
could anyone help??
I'm really stuck with the code of the running total. It adds-up the weight only if I click in the textbox containing the weight. What I can't do is delete something from the list and delete it's weight from the total as well.
thanx for any help
Show ToolTipText Inside Listbox On Long Entries SOLVED!!
For those trying to show ToolTipText on long listbox entries while form's ScaleMode is set to Pixel AND as long as form's Autoredraw being set to False isn't a problem THEN this will work.
BTW, thanks to Hack for his input
Option ExplicitPrivate Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Integer, ByVal wParam As Integer, lParam As Any) As Long Private Declare Function GetSystemMetrics Lib "user32" (ByVal nIndex As Long) As Long ' to displays tooltiptext when over listbox itemPrivate Const SM_CXHTHUMB = 10 Private Const LB_ITEMFROMPOINT = &H1A9 Private Sub List1_MouseMove(Button As Integer, Shift As Integer, x As Single, Y As Single)Dim MousePos '[color=red]will return Overflow message if Dim As Long or As Integer. why ??[/color]Dim PositionX As LongDim PositionY As Long'the SendMessage API will not accept values declared As Single, therefore, the X and Y'portions of the MouseMove parameters have to be converted to a Long. Also, a ListBox'control maintains its X/Y position in twips. SendMessage does not understand twips,'therefore, X/Y must be converted to pixels.PositionX = CLng(x / Screen.TwipsPerPixelX)PositionY = CLng(Y / Screen.TwipsPerPixelY)'MousePos will contain the index of the the ListBox itemMousePos = SendMessage((List1.hWnd), LB_ITEMFROMPOINT, 0, ByVal ((PositionY * 65536) + PositionX)) With List1 'the If statement next is necessary to ensure that the mouse is 'over a valid list box entry. If (MousePos >= 0) And (MousePos <= .ListCount - 1) Then If TextWidth(.List(MousePos)) >= .Width - CInt(GetSystemMetrics(SM_CXHTHUMB)) Then .ToolTipText = .List(MousePos) Else .ToolTipText = "" End If Else .ToolTipText = "" End If End WithEnd Sub
Adding Entries To Txt Files
i need to be able to add entries to atxt file, but every time i do this it overwrites the last entry (i.e. i can only get one entry at a time how can i make the txt file have multiple entries and the computet to be able to read them.
Deleting Entries From Ini Files.... ?
I know how to read & write ini files, but how do you remove entris? Is there an API function? ... something like WritePrivateProfileString that delets?
Listbox ItemCheck Stuff
Im trying to use the Listbox with the checkbox style. Does anyone know how to pick up whether or not the selection is checked or unchecked??
I know there is an ItemCheck event but this just detects a change not whether it is checked or not.
Any help would be much appreciated........
Listbox Help (sorting Stuff)
Have a listbox with a few thousand items.
Want to know how to do the following seperate things:
Loop through and sort ascending / descending.
Loop through and remove all duplicates or move them to another listbox.
Loop through and remove all NON duplicates or move them to another listbox.
Loop through and count all duplicates.
Listbox Sorting Type Stuff
i have this code
For i = 1 To 20 List1.AddItem iNext i = 3Do List1.AddItem vbNullString, i i = i + 4Loop Until i >= List1.ListCount - 1
and it works the way its supposed too. It groups items in threes and seperates them with a space...however, after all the actual entries are placed, it adds the numbers from 1 to list1.listcount - 1 at end of the list.
How do i stop this from happening?
Loading Stuff Into Listbox Using Registry
I want to be able to have the program automatically save what is in the listboxes to the registry and load what was in there to the boxes on program loadup again...
This is the only way that I have heard it is true to do this...So I am wanting to do this anyway...
Also how do you make whatever item you click in the listbox goto a certain textbox? Thanks!
Deleting Double Entries In Text Files. How To?
I have a text file with the following information:
name, address, phone number
I want to use vb to delete entries with the same name, so I would
have only the latest updated information about that name.
how can I do this with vb?
[solved] Sorting Entries In Text Files
foe example i have a text file named mydbs.txt
the entries inside it are
how do i get the entries to be sorted where the highest entry is on the top of the file...