Click here to Skip to main content
15,888,610 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have 2 problem in Vb 6 that It made my headache.
Problem 1:
I use codeing to create a listbox as below:
Dim lxbox As Listbox
Set lxbox = New ListBox

but it show error "Compile error: Invalid use og new keyword". I don't know how to declare a listBox! Help me.

Problem 2:
I have a datagrid and a listbox(created by interface) and my application action as below: when I click on a column(field) in dataGrid,this columntyle is change to button(the same as combobox) and listview is appeared.The problem in here is when listbox is appeared, it is appeared Behind on datagrid so I can see listbox and data on listbox. I want listbox would appeared above datagrid.

I hope that you will help me because I am beginer in VB6.
thanks!
Posted
Updated 20-Dec-10 22:46pm
v2
Comments
Toniyo Jackson 21-Dec-10 4:46am    
Always use pre tag for code.

VB
Dim lst As ListBox
Set lst = Me.Controls.Add("VB.ListBox", "lst", Form1)
lst.Left = 10
lst.Top = 10
lst.Height = 1000
lst.Width = 1000
lst.Visible = True
lst.ZOrder 0
 
Share this answer
 
Comments
ngthtra 20-Dec-10 20:25pm    
thanks goutam Patra, I resolveed this problem.
Hi
you most add New in your Dim to solve this problem
Dim lst As New ListBox
 
Share this answer
 
v2
Comments
Toniyo Jackson 21-Dec-10 4:46am    
Always use pre tag for code.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900