本帖最后由 chzj589 于 2020-4-19 10:08 编辑
这样试试看
Func WM_COMMAND($hWnd, $iMsg, $iwParam, $ilParam)
#forceref $hWnd, $iMsg
Local $hWndFrom, $iIDFrom, $iCode
$hWndFrom = $ilParam
$iIDFrom = BitAND($iwParam, 0xFFFF) ; Low Word
$iCode = BitShift($iwParam, 16) ; Hi Word
$a = GUIGetCursorInfo($WinMainSub2)
Switch $iIDFrom
Case $Input24
If $a[2] = 0 Then
_XRichEditxaD()
;Else
EndIf
EndSwitch
Return $GUI_RUNDEFMSG
EndFunc ;==>WM_COMMAND
Func _XRichEditxaD();搜索信息查询
Local $sQueryText = ''
Local $sCondition, $hQuery, $aRow
$sColumn_Name = GUICtrlRead($Combo12)
If $sColumn_Name = "编码" Then $sColumn_Name = "column1"
If $sColumn_Name = "描述" Then $sColumn_Name = "column2"
If $sColumn_Name = "简称" Then $sColumn_Name = "column3"
If $sColumn_Name = "分类" Then $sColumn_Name = "column4"
$sCondition = $sColumn_Name & ' LIKE "%' & _GUICtrlComboBox_GetEditText($Input24) & '%"'
GUICtrlSendMsg($ListView1, 4105, 0, 0)
_SQLite_Open($sSQLite_DB_Path)
_SQLite_Query(-1, 'SELECT * FROM TestTable WHERE ' & $sCondition, $hQuery)
;GUICtrlCreateListViewItem($sQueryText, $ListView1)
While _SQLite_FetchData($hQuery, $aRow) = $SQLITE_OK
$sQueryText = $aRow[0] & '|' & $aRow[1] & '|' & $aRow[2] & '|' & $aRow[3] & '|' & $aRow[4] & '|' & $aRow[5]
GUICtrlCreateListViewItem($sQueryText, $ListView1)
WEnd
_SQLite_Close()
EndFunc ;==>_XRichEditxaD
|