Results 1 to 21 of 21

Thread: ListBox Control [CONTINUED]

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Dec 2004
    Posts
    129

    Question ListBox Control [CONTINUED]

    What i am trying to do is use a ListBox in a control and be able to use most of the options the ListBox has from the control. For example i figured out how change the BackColor using somthing like this.

    VB Code:
    1. ' GET BACKGROUND COLOR
    2. Public Property Get BackColor() As String
    3.     BackColor = List1.BackColor
    4. End Property
    5. Public Property Let BackColor(ByVal NewBackColor As String)
    6.     List1.BackColor = NewBackColor
    7. End Property

    My Listbox in the Control is named List1 as you can see from the above code.

    What i can't figure out is how to use Let and Get for the " List Feature in the Listbox "
    Eg..



    VB Code:
    1. idx = List1.ListIndex
    2.            writeINI List1.List(idx), "Index", "ListIdx", App.Path & "\settings.ini"


    Can Anyone Help me out In how to get the rest of the features of this listbox to work with my control?

    I will be searchign on google until i hear a responce or find an answer..

    Thanks in advance for anyone who can help.
    Last edited by SllX; Feb 8th, 2005 at 04:38 PM.

  2. #2

    Thread Starter
    Addicted Member
    Join Date
    Dec 2004
    Posts
    129

    Re: ListBox Control

    Ive been searching the net and i still have not found an answer to my problem. Someone on another forum o was reading said it can be done using a property page. I'm not sure what that is

    I guess im going to have to keep looking. No replies on here yet

  3. #3
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: ListBox Control

    What are you tryig to do? Why can't you use the regular listbox?

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Dec 2004
    Posts
    129

    Re: ListBox Control

    Quote Originally Posted by dglienna
    What are you tryig to do? Why can't you use the regular listbox?
    A regular list box scrollbar isnt very touch screen friendly. Unless there is somthign i dont knwo about. Ive been strugling with this issue for a while now and i have not been having any luck.

  5. #5
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: ListBox Control

    Doesn't the touchscreen function like a mouse? Wherever you click is the same as where you touch?

  6. #6

    Thread Starter
    Addicted Member
    Join Date
    Dec 2004
    Posts
    129

    Re: ListBox Control

    Quote Originally Posted by dglienna
    Doesn't the touchscreen function like a mouse? Wherever you click is the same as where you touch?
    The scrollbars are rather small on smaller screens making it very hard to actually scroll. Especially for someone with lrger fingers.........

  7. #7
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: ListBox Control

    The listbox doesn't have a scrollbar property. They are automatic. That is a problem. Maybe you could use a slider control?

  8. #8

    Thread Starter
    Addicted Member
    Join Date
    Dec 2004
    Posts
    129

    Re: ListBox Control

    Quote Originally Posted by dglienna
    The listbox doesn't have a scrollbar property. They are automatic. That is a problem. Maybe you could use a slider control?
    Ive managed to get a custom scrollbar to scroll the listbox within the control to the value of teh scrollbar. Ive got everythign working great except for the one the isse i have explained above..

  9. #9
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: ListBox Control

    What does WriteINI have to do with it? That is confusing.

  10. #10

    Thread Starter
    Addicted Member
    Join Date
    Dec 2004
    Posts
    129

    Re: ListBox Control

    Quote Originally Posted by dglienna
    What does WriteINI have to do with it? That is confusing.
    VB Code:
    1. idx = List1.ListIndex
    2. Label1.caption =  List1.List(idx)

    There....
    instead of writing the value to an ini file it'll show it in the caption of a label.

    What i am doing with the info that the array .list gives doesn't relaly matter its how to make it so i can retrieve the info from the control.

  11. #11
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: ListBox Control

    Send the project, and I'll take a look at it. I don't see any solution right now, but that's because I cant envision how you are making a class of a listbox.

    I found this:

    http://www.planet-source-code.com/vb...xtCodeId=58629

  12. #12
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    Re: ListBox Control

    Does your version of VB include the ActiveX Control Interface Wizard? If it does, use it. Its a big help when creating user controls. Here is the code the wizard generates to implement the List properties.

    VB Code:
    1. 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
    2. 'MappingInfo=List1,List1,-1,List
    3. Public Property Get List(ByVal Index As Integer) As String
    4.     List = List1.List(Index)
    5. End Property
    6.  
    7. Public Property Let List(ByVal Index As Integer, ByVal New_List As String)
    8.     List1.List(Index) = New_List
    9.     PropertyChanged "List"
    10. End Property

  13. #13
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    Re: ListBox Control

    And here is the code it generates for the BackColor property. By using As OLE_COLOR instead of As String, the standard Color Dialog box is available in the property page.

    VB Code:
    1. 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
    2. 'MappingInfo=UserControl,UserControl,-1,BackColor
    3. Public Property Get BackColor() As OLE_COLOR
    4.     BackColor = UserControl.BackColor
    5. End Property
    6.  
    7. Public Property Let BackColor(ByVal New_BackColor As OLE_COLOR)
    8.     UserControl.BackColor() = New_BackColor
    9.     PropertyChanged "BackColor"
    10. End Property

  14. #14
    Frenzied Member Tec-Nico's Avatar
    Join Date
    Jun 2002
    Location
    México
    Posts
    1,192

    Re: ListBox Control [RESOLVED] THANKS brucevde !!!

    Excuse me, Bruce... How would that be for a ComboBox named "ComboBox"? Or where can I find that wizard?
    We miss you, friend... Rest in Peace, we will take care of the rest of it.

    [vbcode]
    On Error Me.Fault = False
    [/vbcode]
    - Silence is the human way to share ignorance
    Tec-Nico

  15. #15
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: ListBox Control [RESOLVED] THANKS brucevde !!!

    It is in Enterprise Edition. Sorry if I didn't mention that.

  16. #16
    Frenzied Member Tec-Nico's Avatar
    Join Date
    Jun 2002
    Location
    México
    Posts
    1,192

    Re: ListBox Control [RESOLVED] THANKS brucevde !!!

    Thank you, David. I found it.
    We miss you, friend... Rest in Peace, we will take care of the rest of it.

    [vbcode]
    On Error Me.Fault = False
    [/vbcode]
    - Silence is the human way to share ignorance
    Tec-Nico

  17. #17

    Thread Starter
    Addicted Member
    Join Date
    Dec 2004
    Posts
    129

    Re: ListBox Control [RESOLVED] THANKS brucevde !!!

    Quote Originally Posted by dglienna
    It is in Enterprise Edition. Sorry if I didn't mention that.

    I can't seem to find this wizard .. " ActiveX Control Interface Wizard? "

    Can you explain to me where to find it please.

    VB Code:
    1. For i = 1 To ListView1.Listitems.ListCount
    2.    If ListView1.ListItems(i).Selected = True Then
    3.         ListBox1.AddItem ListView1.selectedItem.ListSubItems(1) & " - " & ListView1.ListItems(i)
    4.         ListBox2.AddItem ListView1.selectedItem.ListSubItems(4)
    5.     End If
    6. Next

    I am trying to figure out how to get this option from a listview to work in my control. Taking all the selected items from the listview in my control and taking that info and entering it into ListBox's. I think its similar to the one i was looking for to use in the ListBox, but i am not having any luck.


    Any thoughts?

  18. #18
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: ListBox Control [CONTINUED]

    This one? I thought I posted it before. Just click on Add-Ins, and then Add-In Manager to get this screen.
    Attached Images Attached Images  

  19. #19

    Thread Starter
    Addicted Member
    Join Date
    Dec 2004
    Posts
    129

    Re: ListBox Control [CONTINUED]

    Thanks David.

    The wizard doesnt sho what i am tryig to do. SO there has to be a different way to do this. I managed to get the Listview listitems and subitems to show as single items. There has to be a way to make an array to get the rest of the selected items in the listview list.

    Still trying .....................

  20. #20

    Thread Starter
    Addicted Member
    Join Date
    Dec 2004
    Posts
    129

    Re: ListBox Control [CONTINUED]

    Someone on this board must know what i am looking for........

  21. #21
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: ListBox Control [CONTINUED]


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width