Friday, 5 November 2010

Exploring Drop Down...Multicolumns

Many times the case where by one list of drop downs is not enough business request for multiple columns for the drop downs list for one chosen item.

Face with the issue heres my quick code for the same to overcome...

'Lets populate the and set the control parameters.
    obj.Clear 'Clear ne thing from the pre population of control if already done.
    obj.ColumnCount = 2 'Set the number of columns required to display.
    obj.ColumnWidths = "150;150" 'Set the size if columns
       For i = 1 To NoOfItems
                With obj
                    .AddItem "column1 item"
                    .List(custom_Counter, 1) = "column2 item"
                    custom_Counter = custom_Counter + 1
                End With
       Next i                         

'DropDown Change Event
      obj.List(obj.ListIndex , 0) 'Return you the selected 1st column value
      obj.List(obj.ListIndex , 1) 'Return you the selected 2nd column value

and there you go .. Thats out multi column drop down box....

Download Solution
Download solution

No comments: