EKY32 Posted August 18, 2012 Posted August 18, 2012 (edited) It is impossible to create any control on the top of a GuiCtrlCreateListView, i want a label that says "no result" when the list view is empty.. is that possible anyway i don't know? Thank you. Edited August 18, 2012 by EKY32 [font="'trebuchet ms', helvetica, sans-serif;"]Please mark the answer of your question if you found it.[/font]
JScript Posted August 18, 2012 Posted August 18, 2012 (edited) Maybe an ToolTip(), MsgBox() or use this UDF: Regards,João Carlos. Edited August 18, 2012 by JScript http://forum.autoitbrasil.com/ (AutoIt v3 Brazil!!!) Somewhere Out ThereJames Ingram Download Dropbox - Simplify your life!Your virtual HD wherever you go, anywhere!
EKY32 Posted August 18, 2012 Author Posted August 18, 2012 Well well, thanls again it's useful But sir, i saw many programs have a list view control with an ordinary label on it, looks like this:I'll be thankful if there is a better way.Thank you you are great. [font="'trebuchet ms', helvetica, sans-serif;"]Please mark the answer of your question if you found it.[/font]
JScript Posted August 18, 2012 Posted August 18, 2012 Ok, try the example below: expandcollapse popup#include <GUIConstantsEx.au3> #include <GuiListView.au3> #include <WinAPI.au3> #include <WindowsConstants.au3> Global Const $clrWindowText = _WinAPI_GetSysColor($COLOR_WINDOWTEXT) Global Const $clrWindow = _WinAPI_GetSysColor($COLOR_WINDOW) Global $hForm, $hListView, $tRECT, $hDC $tRECT = DllStructCreate($tagRect) DllStructSetData($tRECT, "Left", 100) DllStructSetData($tRECT, "Top", 100) DllStructSetData($tRECT, "Right", 300) DllStructSetData($tRECT, "Bottom", 250) $Debug_LV = False ; Check ClassName being passed to ListView functions, set to True and use a handle to another control to see it work _Main() Func _Main() $hForm = GUICreate("ListView label example.", 640, 300) $hListView = GUICtrlCreateListView("", 2, 2, 636, 268) $hListView = GUICtrlGetHandle($hListView) ; Add columns _GUICtrlListView_AddColumn($hListView, "Filename", 340) _GUICtrlListView_AddColumn($hListView, "Filesize", 80) _GUICtrlListView_AddColumn($hListView, "Filetype", 100) _GUICtrlListView_AddColumn($hListView, "Last modified", 100) ; uncomment to view result! ;_GUICtrlListView_AddItem($hListView, "Row 1: Col 1", 0) GUISetState() $hDC = _WinAPI_GetDC($hListView) _WM_PAINT() GUIRegisterMsg($WM_PAINT, "_WM_PAINT") ; Loop until user exits Do Until GUIGetMsg() = $GUI_EVENT_CLOSE _Exit() EndFunc ;==>_Main Func _WM_PAINT() Select Case Not _GUICtrlListView_GetItemCount($hListView) _WinAPI_UpdateWindow($hForm) _WinAPI_DrawText($hDC, "The list view is empty!", $tRECT, $DT_CENTER) _WinAPI_SetTextColor($hDC, $clrWindowText) _WinAPI_SetBkColor($hDC, $clrWindow) _WinAPI_SetBkMode($hDC, $TRANSPARENT) EndSelect Return 'GUI_RUNDEFMSG' EndFunc ;==>_WM_PAINT Func _Exit() _WinAPI_ReleaseDC(0, $hDC) _WinAPI_InvalidateRect(0, 0) $tRECT = 0 Exit EndFunc ;==>_Exit Regards, João Carlos. http://forum.autoitbrasil.com/ (AutoIt v3 Brazil!!!) Somewhere Out ThereJames Ingram Download Dropbox - Simplify your life!Your virtual HD wherever you go, anywhere!
EKY32 Posted August 18, 2012 Author Posted August 18, 2012 WELL!! I think I will own you my life some day!Thank you it's great. [font="'trebuchet ms', helvetica, sans-serif;"]Please mark the answer of your question if you found it.[/font]
JScript Posted August 18, 2012 Posted August 18, 2012 http://forum.autoitbrasil.com/ (AutoIt v3 Brazil!!!) Somewhere Out ThereJames Ingram Download Dropbox - Simplify your life!Your virtual HD wherever you go, anywhere!
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now