cMonths = "January,February,March,April,May,June,July,August,September,October,November,December" oComboForm = CreateObject ("frmComboTest") oComboForm.Show () Clear Events Define Class frmComboTest as Form *------ ----- ------------ -- ---- Height = 80 Width = 210 Name = "frmComboTest" Caption = " Form containing a ComboBox" WindowType = 1 Closable = .T. ControlBox = .T. MaxButton = .F. MinButton = .F. Movable = .T. ZoomBox = .F. SizeBox = .F. AutoCenter = .T. ShowWindow = 0 Add Object cboMonths as cPtrComboBox with Top = 25 , ; Left = 10 , ; Width = 80 , ; RowSourceType = 1 , ; RowSource = cMonths , ; ColumnCount = 1 , ; ColumnWidths = "80" , ; Style = 2 , ; DisplayCount = 12 , ; Value = 1 Add Object cmdCancel as CommandButton with Top = 20 , ; Left = 130 , ; Height = 25 , ; Width = 75 , ; FontName = "Arial" , ; FontSize = 8 , ; Cancel = .T. , ; Caption = "\<Close" Procedure cmdCancel.Click * --------- ----- ThisForm.Release EndProc Procedure cboMonths.Click * --------- ----- MessageBox ("You selected " + This.List (This.ListIndex) ) EndProc Procedure QueryUnload * ----------- ThisForm.cmdCancel.Click NoDefault Return .T. EndProc EndDefine Define Class cPtrComboBox as ComboBox *------ ----- ------------ -- -------- Height = 20 Width = 150 Margin = 0 Enabled = .T. Visible = .T. ReadOnly = .F. Style = 0 FontName = "Arial" FontSize = 8 EndDefine