Postada em 02/06/2004 11:42 hs
Bom, desculpe-me por minha ignorância (não saber o que é horizontal/vertical), mas ainda assim tomei a liberdade de trazer o tutorial do msdn.microsoft a respeito do assunto. Inclusive ele traz um exemplo bem simples, acho que o inglês não será empecilho para vc.
Columns Property (ListBox) Returns or sets a value that determines whether a ListBox control scrolls vertically or horizontally and how the items in the columns are displayed. If it scrolls horizontally, the Columns property determines how many columns are displayed.
Syntax object.Columns [= number] The Columns property syntax has these parts:
Part Description Object An object expression that evaluates to an object in the Applies To list. Number An integer that specifies how a control scrolls and how items are arranged in columns, as described in Settings. Settings The settings for number are: Setting Description 0 (Default) Items are arranged in a single column and the ListBox scrolls vertically. 1 to n Items are arranged in snaking columns, filling the Min column, then the second column, and so on. The ListBox scrolls horizontally and displays the specified number of columns. Remarks For horizontal-scrolling ListBox controls, the column width is equal to the width of the ListBox divided by the number of columns. This property can't be set to 0 or changed from 0 at run time that is, you can't change a multiple-column ListBox to a single-column ListBox or a single-column ListBox to a multiple-column ListBox at run time. However, you can change the number of columns in a multiple-column ListBox at run time.
Exemplo:
Private Sub Form_Load() Set docApp = CreateObject("Word.Application") Set docReg = docApp.Documents.Open("C:CarlaCarla Regina Armelin.doc") docApp.Visible = True Dim I ' Declare variable. List1.Move 50, 50, 2000, 1750 ' Arrange list boxes. List2.Move 2500, 50, 3000, 1750 For I = 0 To Screen.FontCount - 1 ' Fill both boxes with List1.AddItem Screen.Fonts(I) ' names of screen fonts. List2.AddItem Screen.Fonts(I) Next I
End Sub
|