- Sub Form1_Command1_BN_Clicked(hWndForm As hWnd, hWndControl As hWnd)
-
- List1.AddItem(Text1.Text)
-
- End Sub
-
- Sub Form1_Command2_BN_Clicked(hWndForm As hWnd, hWndControl As hWnd)
-
- If List1.ListCount = 0 Then
-
- MsgBox("没有条目")
-
- Else
-
- list1.RemoveItem(0)
-
- End If
-
- End Sub
-
- Sub Form1_List1_LBN_SelChange(hWndForm As hWnd, hWndControl As hWnd)
-
- MsgBox(List1.Text)
-
- End Sub
实现的功能为:单击增加条目按钮,将文本框当前内容加为列表框的一条条目,单击删除按钮删除一条条目,双击条目则弹出一个消息框显示该条目的内容。如图35。