Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Object
Message
From
12/05/2004 23:04:25
 
General information
Forum:
Visual Basic
Category:
Coding, syntax & commands
Title:
Re: Object
Miscellaneous
Thread ID:
00902939
Message ID:
00903469
Views:
13
'Hello my friend:

'I didn 't understand exactly what is that u need, u told me ListView and I dont know if u are
'refering to the Listview control, which is the one that u can set columns of files, or display them
'as icons, or sort them by clicking on the header's or whatever the listview is for, cus is a multiple uses control

'Nevertheless, by what you've explained me u need, it's seems to be a listbox that u need, or at least
'that is what I understand u need,if I'm wrong let me know pal, we are here to learn right? but Anyway
'whatever it is, let me know first what are u setting in your form, what controls are u placing, and mainly
'let me know what is it that this form will do in your application, that way I can have an idea of what is it
'that u need or how can I help u with the solutions or advises I might give u, you know man more details make people happy dun u think?.

'In this case, u said u need users to type in a textbox how many combos to display on the listview and I might ask u a few things about this case:

'1) are u gonna create combos at runtime? and how are u gonna do it?
'2) do u have a combo already place on form to create instances of that one in listview?
'3) if u do have instances created from a combo control: do u have data already added in your combos to display?
'4) once u display the combos, are u gonna use the data from combo to listview or any other control in form1?

'I might suggest you the use of Hierarchical FlexGrid with the combos on the cells to display combos in columns, that control is great man!

'Oki, Doki, enough of that! too many questions! now to our example friend!

'Here is the case I understand u need, if is not this what u need, correct me for I can help u, but give me more
'info on your problem or your questions in order to help u more friend, the more u give me about the problem and the application GUI
'the more I can have the basic idea of what u need man. Now go to try this man, cus Visual Basic is always Fun!

'start a new project, form1 is set by default. Place a Combo and a ListBox control on Form1
'set combo visible property to false, we dont want to see it yet.
Option Explicit
'Here I populate the combo and the listbox, with whatever text or something, check yourself what it does pal!
Private Sub Form_Load()
Me.List1.AddItem "HAY UN LOCO EN MI CASA"
Me.List1.AddItem "YO, IRENE Y MI OTRO YO"
Me.List1.AddItem "LA PASSION DEL CRISTO"
Me.List1.AddItem "DESPIERTA AMERICA"
Me.List1.AddItem "Y LA LUNA DONDE ESTA"
Me.List1.AddItem "QUE PASO CON USTEDES"
Me.List1.AddItem "BIENVENIDOS TODOS"

'POP THE COMBO HERE, WE GONNA USE THIS ONE TO CHANGE TEXT ON LISTBOX, U WILL SEE MAN! NO JOKE!(just kidding!)
With Combo1
.AddItem "Con Visual Basic todo lo puedo"
.AddItem "Vean como cambio el texto en el List1!"
.AddItem "Viva Visual Basic 6"
.AddItem "Aun no se que dia es hoy!"
.AddItem "Viva Nicaragua!"
.AddItem "Donde quieres ir hoy?"
.AddItem "Alvison Hunter Arnuero ama VB!" 'this one I love most! :o)
End With
End Sub

'Here I set the combo1 left and top properties, by setting these with the values
'of list1.left plus 2 and the Y coord of the mouse, it looks chills man, check it out!

Private Sub List1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
With Combo1
.Visible = True
.Left = List1.Left + 2
.Top = Y
.ZOrder 0 'lets make it appears on top not behind List1
End With
End Sub

Private Sub Combo1_Click()
Dim cadena As String
Dim actual As Integer
cadena = Combo1.Text
actual = List1.ListIndex
List1.List(actual) = Combo1.Text
If Not Combo1.Visible = 0 Then
Combo1.ZOrder 1
End If
End Sub

'When clickin' this button just creates instances of Combo1, not a copy of the Combo1 control
'therefore Friend, whatever u do to Combo1 properties it will be set on these instances as well(just like C++ objects)

Private Sub Command1_Click()
Dim myCombo As ComboBox ' this variable to create multiples instances of combo1
Set myCombo = Combo1 'lets establish here the new instance of Combo1
With myCombo
.Visible = True
.ZOrder 0
.Left = Combo1.Left + 10 'this just to play around with left and top properties
.Top = Combo1.Top + 10 'but you can set your own left and top properties for this instance
End With
End Sub

Hope this can help u man, let me know if I need something!
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform