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:
' GET BACKGROUND COLOR
Public Property Get BackColor() As String
BackColor = List1.BackColor
End Property
Public Property Let BackColor(ByVal NewBackColor As String)
List1.BackColor = NewBackColor
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..
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
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.
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..
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.
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:
'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
'MappingInfo=List1,List1,-1,List
Public Property Get List(ByVal Index As Integer) As String
List = List1.List(Index)
End Property
Public Property Let List(ByVal Index As Integer, ByVal New_List As String)
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:
'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
'MappingInfo=UserControl,UserControl,-1,BackColor
Public Property Get BackColor() As OLE_COLOR
BackColor = UserControl.BackColor
End Property
Public Property Let BackColor(ByVal New_BackColor As OLE_COLOR)
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.
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.