Hi,
ich hab es dank der UDF von Bugfix hinbekommen einzelne Items in meiner ListView farbig darzustellen.
Jetzt hab ich nur noch ein Problem dass ich nicht ganz nachvollziehen kann.
Wenn ich in der Listview die Spalten per Maus verändere ändert sich plötzlich die Schriftgröße in der kompletten Spalte und wird winzig klein.
Ich hab mal ein Teil meines Scriptes modifiziert und eingestellt:
Spoiler anzeigen
;*** Einbinden der Includes ***
#include <GUIConstantsEx.au3>
#include <Constants.au3>
#include <WindowsConstants.au3>
#include <GuiListView.au3>
#include <LV_Format_include.au3>
;******************************
_Showdate ()
Func _Showdate () ;*** Anzeige der letzten Sicherung
Local $hGUIShow, $hListView1, $hListView2, $k, $l, $hButton, $hLabel1ListView, $hLabel2ListView
Local $aInfos1, $aInfos2, $hLVHandl1, $hLVHandl2, $nAnzItem, $sItemText
;*** GUI definieren
$hGUIShow = GUICreate("letzte Sicherung ...",1040,300,-1,-1,-1,-1)
$hLabel1ListView = GUICtrlCreateLabel("Sicherung1",10,10,120,30,1,-1)
GUICtrlSetFont(-1,14,700,0,"Times New Roman")
$hLabel2ListView = GUICtrlCreateLabel("Sicherung2",530,10,120,30,1,-1)
GUICtrlSetFont(-1,14,700,0,"Times New Roman")
$hListView1 = GUICtrlCreatelistview("Quellpfad|Zeitpunkt|Medium|Status",10,50,500,150,-1,$LVS_EX_SNAPTOGRID)
$hLVHandl1 = GUICtrlGetHandle($hListView1)
$hListView2 = GUICtrlCreatelistview("Quellpfad|Zeitpunkt|Medium|Status",530,50,500,150,-1,$LVS_EX_SNAPTOGRID)
$hLVHandl2 = GUICtrlGetHandle($hListView2)
$hButton = GUICtrlCreateButton("Ok",400,230,50,30,-1,-1)
GUICtrlSetFont(-1,11,700,0,"Times New Roman")
Local $aHWnd[2] = [$hLVHandl1,$hLVHandl2]
_GUICtrlListView_Formatting_Startup($hGUIShow, $aHWnd)
;***
;*** ListView befüllen
_GUICtrlListView_AddOrIns_Item($hLVHandl1,"C:\Test|01.01.2014 10:00:00|G: USB|" & Chrw(10004), $hListView1)
_GUICtrlListView_AddOrIns_Item($hLVHandl1,"C:\Daten|01.02.2014 11:00:00|G: USB|" & Chrw(10004), $hListView1)
_GUICtrlListView_AddOrIns_Item($hLVHandl2,"C:\Test|01.03.2014 16:00:00|G: USB|" & Chrw(10006), $hListView2)
_GUICtrlListView_AddOrIns_Item($hLVHandl2,"C:\Test1|01.06.2014 17:00:00|G: USB|" & Chrw(10004), $hListView2)
;***
;*** Chrw(1004) und Chrw(1006) in ListView1 einfärben
$nAnzItem = _GUICtrlListView_GetItemCount($hLVHandl1)
For $k = 0 To $nAnzItem -1
$sItemText = _GUICtrlListView_GetItemText($hLVHandl1, $k , 3)
If $sItemText = Chrw(10004) Then _GUICtrlListView_FormattingCell($hLVHandl1, $k, 3, -1, 0x00FF00, 20, -1, 'Times New Roman')
If $sItemText = Chrw(10006) Then _GUICtrlListView_FormattingCell($hLVHandl1, $k, 3, -1, 0xFF0000, 20, -1, 'Times New Roman')
Next
;***
;*** Chrw(1004) und Chrw(1006) in ListView2 einfärben
$nAnzItem = _GUICtrlListView_GetItemCount($hLVHandl2)
For $l = 0 To $nAnzItem -1
$sItemText = _GUICtrlListView_GetItemText($hLVHandl2, $l , 3)
If $sItemText = Chrw(10004) Then _GUICtrlListView_FormattingCell($hLVHandl2, $l, 3, -1, 0x00FF00, 20, -1, 'Times New Roman')
If $sItemText = Chrw(10006) Then _GUICtrlListView_FormattingCell($hLVHandl2, $l, 3, -1, 0xFF0000, 20, -1, 'Times New Roman')
Next
;***
GUISetState(@SW_SHOW,$hGUIShow)
While 1
$nMsgShow = GUIGetMsg()
Switch $nMsgShow
Case $GUI_EVENT_CLOSE
GUIDelete($hGUIShow)
ExitLoop
Case $hButton
GUIDelete($hGUIShow)
ExitLoop
EndSwitch
WEnd
EndFunc
Was mache ich falsch ?
Gruß
Markus