|
-
Apr 2nd, 2010, 12:28 PM
#1
Thread Starter
Lively Member
[RESOLVED] listbox modification
Hi,
how to replace selected item in the listbox with the value in textbox?
-
Apr 2nd, 2010, 12:34 PM
#2
Re: listbox modification
List1.List(List1.ListIndex) =
-
Apr 2nd, 2010, 12:34 PM
#3
Re: listbox modification
Code:
Private Sub Command1_Click()
If List1.ListIndex <> -1 Then 'ensure an item is selected
List1.List(List1.ListIndex) = Text1.Text
End If
End Sub
-
Apr 2nd, 2010, 12:46 PM
#4
Thread Starter
Lively Member
Re: listbox modification
after i select the item in listbox in form3, i clicked button that shows form5 with one textbox to enter the replacing value.After this i clicked button in form5 that should replace the value in the form3.listbox with the value form5.textbox..this is the code i used in the buttton event of form5.
vb Code:
Form3.List1.list(List1.ListIndex) = Form5.Text1.Text
but i gets an error "object required"...
-
Apr 2nd, 2010, 12:59 PM
#5
Thread Starter
Lively Member
Re: listbox modification
after i select the item in listbox in form3, i clicked button that shows form5 with one textbox to enter the replacing value.After this i clicked button in form5 that should replace the value in the form3.listbox with the value form5.textbox..this is the code i used in the buttton event of form5.
vb Code:
Form3.List1.list(List1.ListIndex) = Form5.Text1.Text
but i gets an error "object required"... pls help me out
-
Apr 2nd, 2010, 01:04 PM
#6
Re: listbox modification
(List1.ListIndex) that would mean that List1 is on Form5... everywhere that you reference a control from another Form you have to preceed it with form name
Form3.List1.List(Form3.List1.ListIndex) = Form5.Text1.Text
-
Apr 2nd, 2010, 01:13 PM
#7
Thread Starter
Lively Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|