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




Lsitbox


hi,how can I select a item from my listbox and made some event occur?Thanks in advance.wang




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Searching For A Name In A Lsitbox
how would you search for a name in a list box. like if i had a listbox that had these things in it:

blah
blahblah
blahhh

how would i search and find a certain one according to names not index.

Delete Items From A LsitBox
I'm trying to delete items in a listbox that the user has selected. Currently my code deletes half of the items selected. (If 10 items were selected 5 would be deleted from the listbox, and the other 5 will remain). Any suggestions? Thanks


VB Code:
'*CMDVERIFY_CLICK()************************************************************'NAME: cmdVerify_Click()'DESC: Allows the user to verify that they have counted the selected item(s).Private Sub cmdVerify_Click()    Set connection = New ADODB.connection    connection.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _        "Data Source= G:FinanceInventory ControlCycleCountDBcycleCount.mdb"    connection.Open        Dim counter As Integer    Do While counter < lstVerificationScreen.ListCount        If (lstVerificationScreen.Selected(counter) = True) Then             Dim selectStatement, sSQL As String            Dim strArray() As String                        strArray = Split(lstVerificationScreen.List(counter), vbTab, -1, 1)                                           selectStatement = "DELETE FROM [MAIN] WHERE ID=" & strArray(0)                        sSQL = "UPDATE [ALTER] SET TYPEOFCHANGE='DELETED' WHERE [MAIN ID]='" & strArray(0) & "'"                        connection.Execute sSQL                        connection.Execute selectStatement             lstVerificationScreen.RemoveItem (counter)                                End If        DoEvents        counter = counter + 1    Loop            connection.Close    Set connection = Nothing    End Sub'*ENDOF*CMDVERIFY_CLICK()******************************************************  

Using Checkbox In Lsitbox To Save Settings ??
HI,

i'm making a program that wil change registry settings for a user. I want to build in a listbox in checkbox state and the user must be able to click on the item(There by checking it) en then when the press save and the registry settings will be saved. The problem is i dont how how to get selected box's and pass the value's.

Example.: If a user selected NoFind in the list box i must change the dword HKEY_blabanotherkey..NoFind in to 1
normaly i would do this like X=savesettings HKEY_blabanotherkey..check1.value (i when use checkboxes)

But how do i do this with a listbox ??

Thanx in advance for the help

Simple! Moving A Listbox Item For One Lsitbox To Another.
How can I move an item from

lstbox 1 ---> lstbox 2

I want the item to be removed from lstbox 1 and added to lstbox 2

Thanks for anyone who helps.

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