Delete from a listbox in vb6.0

Basically what I am trying to do is find out where in the listbox that the text in text14.text appears in the listbox. That is where the msgbox(smessage) comes in. So for instance if I have this, that, and these in the listbox. How would I find out out the listindex of one of those in the listbox? I have it actually highlighting what is in the listbox. Also the listbox can be sorted or it does not have to be. But can someone help me to find out where my problem is? If I take the comment out of 'List2.RemoveItem Text14.Text then it gives me a type mismatch. Also in the textbox there is just going to be strings and no numberical values in them.

Private Sub Delete_Click()

Dim I As Integer
Dim sMessage As String
sMessage = CInt(Val(Text14.Text))
MsgBox (sMessage)
'If IsNumeric(sMessage) Then
'MsgBox ("1")
For I = 0 To List1.ListIndex Step 1
MsgBox ("2")
If List1.List(I) = Text14.Text Then
List1.RemoveItem I

' Else
MsgBox "Value is not numeric"
Text14.SetFocus
End If
Next I

'End If
End Sub

delete listbox

I used appwizard to create a project. I also add a listbox in my view class. In my listbox, when it is clicked, a user message send back to view class. In the user message handler function in view class, I tried to delete the listbox, it caused an error.LRESULT CMyAppView::WindowProc(UINT message, W ...

delete listbox

I wrote a class "CMyListBox" drived from CListBox in MDI appication using vc6. In my view class, I used the following code to create a CMyListBox:m_pList = new CMyListBox;m_pList->Create(WS_CHILD|WS_VISIBLE|LBS_STANDARD, CRect(80,80,400,300), this, 1888);m_pList is a member variable ...

Highlight/Select certain items in a Listbox [VB6]

Given a RecordSet (oRecs) that contains a list (one column) of names and a ListBox [lbNames] that has the entire list of all names possible (for my program).What I need to do is highlight/select all the names in the listbox [lbNames] that are in the RecordSet (oRecs).Meaning - the user selects a gro ...

Registry search and delete using VB6

I'm pretty new to VB programming and only really use it when needed. This is one of those times. I'm trying to sort out a problem with an Outlook comm addin. It falls over sometimes and doesn't load properly. The only way I have been able to get it working again then is to unregister the DLL file co ...

VB6 Listbox Help, maybe?

I'm working on an RSS Maker for podcasts, and it's been a while since school, so I've forgotten most of my VB6 training.I have two tables created in Access: "Channels," which contain ID, CTitle and ITitle; and "MasterList," which contains ID and MTitle.On my form, I have two List ...

VB6 Listbox Help

NOT HOMEWORK - My friends don't know VB, so I am doing this for them.I have written a program that will pick a random name out of a listbox, because I need it for an activity I am involved in.However, I don't know how to actually display the name chosen from the list. All I get is the index number o ...

[Q]VB6 Getting External Listbox

I am looking out for how to grab a external listbox from another program and save the entries to a text file or load them into a listbox on the program.Is this possible?, where would i start ?I was thinking using the win32 api to read the listbox entries is that possible?Does anyone know of any exam ...

Writing what is in a listbox to a textfile in vb6.0

I was wondering if someone could help me with trying to write what is in a listbox to a textfile. I have fixed my program to display information in a listbox from a textfile. But how would I get the information to be written over in the textfile? I would prefer to not use an array, since I have not ...

Delete on ListBox should delete a Image on View

In my project i am having a ListBox and some other options to create Images On the view. When ever i am adding any images this will create image on the view and simultaniously it will add an entry to the ListBox. Also if i will select any entry on the ListBox the the corresponding image will be sele ...

Delete item from ListBox On Delete button from Key Board

How can i delete an item from the ListBox by pressing the Delete button on the keyboard? ...

Help In ListBox delete portion

I Have build one of the example of my application which is attach in this thread.The Problem is that when I Add a item in the listbox and want to delete it immediately, it cannot delete it completely. For example, I add an item call Test_4 and want to delete it immediately, I click the delete button ...

Delete from a listbox

I have just started to learn VB.i'm making a database using oracle and vb6. i have a listbox of items and a search button. one can see the details of a particular item in the listbox in a couple of textboxes in that same form by clicking on the search button. can anybody tell me how to delete only t ...

listbox help vb6

how dow I remove the item i added without clicking other items on the listi have 3 items each with own cmd's to add to one list. the problem is I only want my cmdremove1 to remove the item cmdadd1 added, to remove cmdremove2...cmdadd2 addded so on ...

Delete an Excel worksheet using VB6

I have created and populated an Excel workbook with 3 worksheets. Sheet1 contains data; Sheet2 and Sheet3 are empty. I massage the data in Sheet1 and enter the output into Sheet2. I would now like to delete Sheet1 and close and save the Excel file.I am embarressed to say I can't figure out how to de ...

Help me find text in a listbox in VB6

I am trying to remove a list item in a listbox... the problem is I have to remove it by the what is visible to the user the program doesnt keep record of the index number in the listboxso we have the following in a list boxBobFredJohnGeorgeJaneJoeAnnaI lets say I need to remove one of these how do I ...

delete items from a listbox in preload

I have 2 listboxes lbxStdBoard and lbxBoard. When I select a value from lbxStdBoard the value apears in lbxBoard. Each listbox is connected to the database. When the value from lbxStdBoard is passed in lbxBoard the value is saved also in the database.Now I have to delete in Preload the values from l ...

Delete Multiple items from Listbox in ASP.NET

I try the foll. code---protected void Button1_Click(object sender, EventArgs e){int i;for (i = 0; i <= ListBox1.Items.Count - 1; i++){ListBox1.Items.Remove(ListBox1.SelectedValue.ToString());}}But it's not working. ...

Add Edit Delete Options on right click in MSFlexGrid Control VB6

Can any one please tell me how to enable a right click option in MSFlexGrid Control. I mean when user right click in any grid row, it ask option Add, Edit, Delete and when user click on any one of them another form will be open and load the values from that row into new form. ...

#Delete in Listbox

I have a listbox that is bound to a table. If the table gets emptied, i want the listbox to be BLANK, instead it displays #DELETE for every item that used to be in the listbox. How do I just get the listbox to be BLANK when there are no items in the table that it is bound to? Many ...

code to delete *.tmp file in vb6

i m using vb6 and acess2000, crystal report 9.i want to delete *.tmp files created due to crystal report 9.i want this in vb6 through coding.pls help me.these files are created on partition and of 0 bytes.so, pls help me its urgent.thanx in advance ...

Delete Records via Listbox??

I have a list box which displays the Id's and Age of people in my database. I use it to select which ID i want to view on a form to show the records full details of about 30 fields.I want to be able to select an ID in the list box, then click a button to delete its entire record from the database.An ...

delete records in a database from the selected item in a listbox.

i would like to ask for the sql statement for deleting a record in the database with the selected items in a listbox. ...

Delete Whole Record In Access Using ListBox

I am totally new here and this is my first post..I have tried many place, since i could get any solution.I have no choice then posting here.basically, i have one delete form, where i will load the firstname from a table in access(hardcode) to listbox.then when a user choose the first name, from list ...

delete a milion of records ado + vb6

I use the tipical ado ject con and vb6 code.I have a access table with approx 4.500.000 records in 43 fields.All field are filled with value.I use the delete * from table ecc.... but sure the code is very very slow...Suggestion please to make a fast way to delete.tks. ...

How do I delete multiple rows from an listbox?

How do I delete multiple rows from an access listbox which has its row source set to a table or query?I can add multiple items from a listbox to a table, but how do I delete multiple items from a table? ...

Delete an listbox item

is it better to use ondeleteitem or delete item to delete an listbox item? hw to use it? ...

[VB6] How to delete symbolic links?

there! Recently, I tried deleting some symbolic links in VB, but it turns out their targets were wiped out as well. More specifically, I'm looking for a way to purge an entire directory from all the files/symlinks it contains, without doing anything to the targets.Any help is much appreciated. ...

How to DELETE and UPDATE access database after remove selected item from VB listbox

i trying to make a code to Delete and Update Access 2007 database after remove a selected item from a listbox in VB 2008. [using "Remove" button that i create]pervious i already make a button to View data from database and Remove from listbox. but i don't know how to delete and update in d ...

How to Delete Selected Items of ListView and ListBox (Snippets)

With ListView and ListBox, you can have multiple selections when you set the property to do so. There are different ways to delete all selected items from a ListView and ListBox, right or wrong. I have some lessons learned on the topic.(1)Use For Each loop in ListView. (It works)For Each i As ListVi ...