Form1.frm
资源名称:ncombo2.zip [点击查看]
上传用户:huyzong
上传日期:2007-01-02
资源大小:7k
文件大小:3k
源码类别:
组合框控件
开发平台:
Visual C++
- VERSION 5.00
- Object = "{DE201785-9000-11D2-8726-0040055C08D9}#1.0#0"; "NCombo.ocx"
- Begin VB.Form Form1
- Caption = "Form1"
- ClientHeight = 3705
- ClientLeft = 60
- ClientTop = 345
- ClientWidth = 4695
- LinkTopic = "Form1"
- ScaleHeight = 3705
- ScaleWidth = 4695
- StartUpPosition = 3 'Windows Default
- Begin VB.ListBox Events
- Height = 1230
- Left = 120
- TabIndex = 1
- Top = 2400
- Width = 4455
- End
- Begin NCOMBOLib.NCombo NCombo1
- Height = 2175
- Left = 120
- TabIndex = 0
- Top = 120
- Width = 4455
- _Version = 65536
- _ExtentX = 7858
- _ExtentY = 529
- _StockProps = 4
- BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
- Name = "Tahoma"
- Size = 9
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- DropDownHeight = 145
- End
- End
- Attribute VB_Name = "Form1"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Private Sub Form_Load()
- Dim recordset As New ADOR.recordset
- recordset.Open "Authors", "Biblio", adOpenStatic
- For Each f In recordset.Fields
- NCombo1.InsertColumn NCombo1.GetColumnCount(), f.Name, 128, 0, True, True
- Next
- If NCombo1.GetColumnCount() <> 0 Then
- While Not recordset.EOF
- nItem = NCombo1.InsertItem(NCombo1.GetItemCount(), "")
- NCombo1.SetItemData nItem, recordset.AbsolutePosition
- i = 0
- For Each f In recordset.Fields
- NCombo1.SetItemText nItem, i, IIf(IsNull(f), "", f)
- i = i + 1
- Next
- recordset.MoveNext
- Wend
- NCombo1.SelectItem = 0
- End If
- End Sub
- Private Sub NCombo1_ChangeColumnContent(ByVal nColumn As Integer, ByVal sColumnContent As String, ByVal nType As Long)
- AddEvent "Change column content: " & nColumn & " " & sColumnContent
- End Sub
- Private Sub NCombo1_ChangeColumnKey(ByVal nColumn As Long)
- AddEvent "Change column key: " & nItem & NCombo1.GetColumnName(nColumn)
- End Sub
- Private Sub NCombo1_ChangedItem(ByVal nItem As Long)
- AddEvent "Changed " & nItem
- End Sub
- Private Sub NCombo1_ChangingItem(ByVal nItem As Long)
- AddEvent "Changing " & nItem
- End Sub
- Private Sub AddEvent(ByVal sItem As String)
- Events.AddItem sItem, 0
- While Events.ListCount > 5
- Events.RemoveItem Events.ListCount - 1
- Wend
- End Sub