marcsusy Posted May 21, 2011 Share Posted May 21, 2011 I would like to know how to place the symbol √ in a column on GUICtrlCreateListView Link to comment Share on other sites More sharing options...
monoscout999 Posted May 22, 2011 Share Posted May 22, 2011 (edited) I would like to know how to place the symbol √ in a column on GUICtrlCreateListView As an item or as the column header? As an item in the first column and the 2nd Row local $width = 400 local $height = 400 $mylist = GUICtrlCreateListView("column 1 |column 2 |column 3 ", 0, 0, $width, $height) $item1 = GUICtrlCreateListViewItem("col1|col2|col3", $mylist) $item1 = GUICtrlCreateListViewItem("√ |col2|col3", $mylist) As column header in the third column example: local $width = 400 local $height = 400 $mylist = GUICtrlCreateListView("column 1 |column 2 |√ ", 0, 0, $width, $height) Edited May 22, 2011 by monoscout999 Link to comment Share on other sites More sharing options...
marcsusy Posted May 22, 2011 Author Share Posted May 22, 2011 my problem is I do not know how to write the √ symbol, I tried and I get a player v AutoIt ascii characters do not, I write using the Wingdings font ü but I can not write it in the gui GUICtrlCreateListViewItem Link to comment Share on other sites More sharing options...
UEZ Posted May 22, 2011 Share Posted May 22, 2011 (edited) You can use unicode characters to display it: Example: MsgBox(0, "Unicode", ChrW(8730)) A table can be found here: http://www.homepage-total.de/html/unicode-tabelle.php Br, UEZ Edited May 22, 2011 by UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
KaFu Posted May 22, 2011 Share Posted May 22, 2011 You also could set the font used to paint the Listview manually to Wingdings by hooking in the WM_NOTIFY $NM_CUSTOMDRAW sequence. Added #AutoIt3Wrapper_UseX64=n because there seems to be something wrong in the structures which makes it fail on x64 ($tagNMLVCUSTOMDRAW wrong?). expandcollapse popup#region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_UseUpx=n #AutoIt3Wrapper_UseX64=n #endregion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <GuiConstantsEx.au3> #include <GuiListView.au3> #include <GuiImageList.au3> #include <WindowsConstants.au3> #include <WinApi.au3> #include <FontConstants.au3> $h_ListView_Font = _WinAPI_CreateFont(14, 0, 0, 0, 500, False, False, False, $DEFAULT_CHARSET, $OUT_DEFAULT_PRECIS, _ $CLIP_DEFAULT_PRECIS, $PROOF_QUALITY, 0, "Wingdings") Global $hListView _Main() _WinAPI_DeleteObject($h_ListView_Font) Func _Main() Local $GUI, $hImage $GUI = GUICreate("(UDF Created) ListView Create", 400, 300) $hListView = _GUICtrlListView_Create($GUI, "", 2, 2, 394, 268) _GUICtrlListView_SetExtendedListViewStyle($hListView, BitOR($LVS_EX_GRIDLINES, $LVS_EX_FULLROWSELECT, $LVS_EX_SUBITEMIMAGES)) GUISetState() GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY") ; Load images $hImage = _GUIImageList_Create() _GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap($hListView, 0xFF0000, 16, 16)) _GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap($hListView, 0x00FF00, 16, 16)) _GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap($hListView, 0x0000FF, 16, 16)) _GUICtrlListView_SetImageList($hListView, $hImage, 1) ; Add columns _GUICtrlListView_InsertColumn($hListView, 0, "Column 1", 100) _GUICtrlListView_InsertColumn($hListView, 1, "Column 2", 100) _GUICtrlListView_InsertColumn($hListView, 2, "Column 3", 100) ; Add items _GUICtrlListView_AddItem($hListView, "Row 1: Col 1", 0) _GUICtrlListView_AddSubItem($hListView, 0, "Row 1: Col 2", 1) _GUICtrlListView_AddSubItem($hListView, 0, "Row 1: Col 3", 2) _GUICtrlListView_AddItem($hListView, "Row 2: Col 1", 1) _GUICtrlListView_AddSubItem($hListView, 1, "Row 2: Col 2", 1) _GUICtrlListView_AddItem($hListView, "Row 3: Col 1", 2) _GUICtrlListView_AddItem($hListView, "ü", 3) ; Loop until user exits Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete() EndFunc ;==>_Main Func WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam) #forceref $hWnd, $iMsg, $iwParam Local $tNMHDR = DllStructCreate($tagNMHDR, $ilParam) Local $hWndFrom = DllStructGetData($tNMHDR, "hWndFrom") Local $nNotifyCode = DllStructGetData($tNMHDR, "Code") Switch $hWndFrom Case $hListView Switch $nNotifyCode Case $NM_CUSTOMDRAW Local $tCustDraw = DllStructCreate($tagNMLVCUSTOMDRAW, $ilParam) Local $iDrawStage = DllStructGetData($tCustDraw, "dwDrawStage") If $iDrawStage = $CDDS_PREPAINT Then Return $CDRF_NOTIFYITEMDRAW If $iDrawStage = $CDDS_ITEMPREPAINT Then Return $CDRF_NOTIFYSUBITEMDRAW Local $iItem = DllStructGetData($tCustDraw, "dwItemSpec") Local $hDC = DllStructGetData($tCustDraw, 'hdc') _WinAPI_SelectObject($hDC, $h_ListView_Font) If Mod($iItem, 2) = 1 Then ;odd row number (0-based) DllStructSetData($tCustDraw, "clrTextBk", 0xF5F5F5) Return $CDRF_NEWFONT EndIf Return $GUI_RUNDEFMSG EndSwitch EndSwitch EndFunc ;==>WM_NOTIFY OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
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