combobox 設置下拉列表無效

http://www.oschina.net/question/1438716_146566ide

import win.ui;
/*DSG{{*/
var winform = ..win.form(text="AAuto Form";right=490;bottom=306)
winform.add(
combobox={cls="combobox";text="combobox";left=108;top=82;right=323;bottom=102;edge=1;items={};mode="dropdown";z=1};
static={cls="static";text="static";left=105;top=103;right=318;bottom=261;hide=1;notify=1;transparent=1;z=2}
)
/*}}*/

import com;
var dataGrid = winform.static.createEmbed("MSFlexGridLib.MSFlexGrid.1"); 
var gd = dataGrid._object

// 初始化界面
with gd{
	Cols =4 // 列
	Rows = 4 //行
	setTextMatrix(0,0,"材料編碼")
	setTextMatrix(0,1,"材料名稱")
	setTextMatrix(0,2,"規格")
	setTextMatrix(0,3,"單位")	
}

winform.combobox.oncommand = function(id,event){
	if(event == 0x7/*_CBN_DROPDOWN*/){
		 ::PostMessage(winform.combobox.hwnd, 0x14F/*_CB_SHOWDROPDOWN*/, 0, 0);
		 winform.static.hide = 0
	}	
}

winform.show() 
win.loopMessage();

關鍵是在cbn_dropdown事件,用PostMessage發送cb_showdropdown消息,用SendMessage發送無效oop

啥時候用postmessage 或sendmessage 有點饒頭???post

相關文章
相關標籤/搜索