一、Frame(容器對象)
子對象的Container屬性
7、Timer
屬性:enable, interval
事件:Timer
注意:timer發生頻率,重入問題
8、ListBox
添加和刪除列表項: AddItem,RemoveItem,Clear,ListIndex,ListCount
字符串數組:List
多列,單選,多選: Columns,MutliSelect, Selected()Sort Style, TopIndex, NewIndex
事件: click, ItemCheck
9、ComboBox
-風格:Strle
-事件:Change,Click
10、OptionBox
-風格:Style
-Value與容器對象:布爾型
11、CheckBox
-風格:Style
-Value=vbChecked 整型
12、HscrollBar,VScroolBar
-位置:Value,Min,Max,LargeChange,SmallChange
-事件:Changed、Scroll
二、關於控件的幾個問題
1、輸入的有效性和檢驗
一般準則:Valiate 事件(檢測用戶輸入的是否有誤)、CauseValidate 屬性(缺省情況下爲真)
2、鼠標的處理和拖拽
3、Drag方法、DragOver、dragdrop事件
三、菜單分類
下拉式菜單
級聯式菜單
彈出菜單
工具--->菜單編輯器
四、菜單的代碼
修改菜單的標題,複選,可視,有效
菜單的事件代碼
顯示彈出式菜單:[object].PopUpMenumenuname[,flags[,x[,y,boldCommand]]]]
五、動態添加菜單項
.Index屬性
.示例
Load mnuMenuItemName(index+1)mnuMenuItemName(index+1).caption="aaaa"
mnuMenuItemName(index+1).visible=true
注意:Load,Index,Visible
六、資源部管理器
.資源類型
--字符串,位圖,光標,圖標,自定義資源
.創建和保存(只能有一個Res文件)
.使用
-LoadResString(StrId)
-LoadResPicture(resID,VbResBitMap)
-LoadResPicture(resID,VbResIcon)
-LoadResPicture(resID,VbResCursor)
-LoadResData(ResId,format)
七、時鐘
關鍵:
-Timer控件的使用
-防止重入的法生
-輕量級控件的使用