Simple question..help please 
Author Message
 Simple question..help please

I have a ListView1 control and 3 text boxes Text1-3 . A user inputs Key
Value into the first, Text Value into the second and Icon Index into the
third. I have an ImageList control with 5 icons in it. Finaly I have a
button that on click() event would add to the ListView base on the parametrs
in the textbox.

I'm stuck on the Add method. This is what I have so far and it gives me
errors
Please help!

Private Sub Command1_Click()
Dim objItem As ListItem
Set objItem = Me.ListView1.object

k = Text1.Text
t = Text2.Text

objItem.ListItems.Add(,Text1.Text,Text2.Text, , )
End Sub

Mike



Thu, 27 Nov 2003 09:57:14 GMT  
 Simple question..help please
Michael,

    Try this..

Private Sub Command1_Click()
    Dim lvItem As ListItem

    Set lvItem = Me.ListView1.ListItems.Add(, Text1.Text, Text2.Text)
    lvItem.Icon = CLng(Text3.Text)
End Sub

Steve Szudzik
http://www.szudzikfamily.com


Quote:
> I have a ListView1 control and 3 text boxes Text1-3 . A user inputs Key
> Value into the first, Text Value into the second and Icon Index into the
> third. I have an ImageList control with 5 icons in it. Finaly I have a
> button that on click() event would add to the ListView base on the
parametrs
> in the textbox.

> I'm stuck on the Add method. This is what I have so far and it gives me
> errors
> Please help!

> Private Sub Command1_Click()
> Dim objItem As ListItem
> Set objItem = Me.ListView1.object

> k = Text1.Text
> t = Text2.Text

> objItem.ListItems.Add(,Text1.Text,Text2.Text, , )
> End Sub

> Mike



Sat, 29 Nov 2003 09:12:26 GMT  
 Simple question..help please
You seem to be complicating a simple problem:

Private Sub Command1_Click()
    ListView1.ListItems.Add , Text1.Text, Text2.Text, Val(Text3.Text),
Val(Text3.Text)
End Sub

Robert

Quote:
> I have a ListView1 control and 3 text boxes Text1-3 . A user inputs Key
> Value into the first, Text Value into the second and Icon Index into the
> third. I have an ImageList control with 5 icons in it. Finaly I have a
> button that on click() event would add to the ListView base on the
parametrs
> in the textbox.

> I'm stuck on the Add method. This is what I have so far and it gives me
> errors
> Please help!

> Private Sub Command1_Click()
> Dim objItem As ListItem
> Set objItem = Me.ListView1.object

> k = Text1.Text
> t = Text2.Text

> objItem.ListItems.Add(,Text1.Text,Text2.Text, , )
> End Sub

> Mike



Fri, 28 Nov 2003 15:56:11 GMT  
 Simple question..help please
Going at it the wrong way...

you are seting objitem to something existing. What you need to do is let the
listview create the new object for you:

dim Item as ListItem

set Item = ListView1.Listitems.Add(,text1.text,text2.text)
now you can set the icon or any other members of Item
Item.text = "I've just changed the text that I set when I added"


Quote:
> I have a ListView1 control and 3 text boxes Text1-3 . A user inputs Key
> Value into the first, Text Value into the second and Icon Index into the
> third. I have an ImageList control with 5 icons in it. Finaly I have a
> button that on click() event would add to the ListView base on the
parametrs
> in the textbox.

> I'm stuck on the Add method. This is what I have so far and it gives me
> errors
> Please help!

> Private Sub Command1_Click()
> Dim objItem As ListItem
> Set objItem = Me.ListView1.object

> k = Text1.Text
> t = Text2.Text

> objItem.ListItems.Add(,Text1.Text,Text2.Text, , )
> End Sub

> Mike



Wed, 03 Dec 2003 23:02:28 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Simple question, help please!

2. SIMPLE SIMPLE ListView Question. Please help

3. PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP,

4. SIMPLE QUESTION, please SIMPLE ANSWER

5. Simple question, please help!

6. Simple question, Please Help!!! :)))

7. Please Help with a simple question

8. Simple Question! Please Help

9. Simple question...please help

10. Please Help with a simple question

11. Please Help With Simple Question

12. PLEASE HELP: simple question

 

 
Powered by phpBB® Forum Software