![]() |
how to set background color for a listbox
Im trying to set background color for a listbox.Is it possible to set background color for a listbox?
|
Yes, it is. You need following:
- HWND of ListBox - MSDN -> Name of message to do your task - Know how to send windows messages. There is a lot of examples in the forum :up: |
Well, it isn't as hard as I thought. You need SetCtlColors instruction.
PHP Code:
|
I have used the following code :
GetDlgItem $1 $HWND 1201 SetCtlColors $1 0xFFFFFF 191970 the listbox is created using ini.The color sets upon the selection of the items in the list box.How can i set the color at once instead of selecting individual items? |
Do it my way! ;)
|
but i need to set the background color on a button event code looks like this :
Function LeaveCustom ReadINIStr$0 "$PLUGINSDIR\showUserList.ini" "Settings" "State" !insertmacro MUI_INSTALLOPTIONS_READ $UserSelection "showUserList.ini" "Field 2" "State" StrCmp $0 0 Done ; Next button? StrCmp $0 3 SelectAll ; select all users StrCmp $0 4 UnselectAll ; unselect all users StrCmp $0 2 ListSelection Abort ; Return to the page SelectAll: ; MessageBox MB_OK|MB_ICONINFORMATION "Select All" ; StrCpy $0 SELECT_ALL StrCpy $isSelectAll "1" GetDlgItem $1 $HWNDPARENT 1 EnableWindow $1 1 GetDlgItem $1 $HWND 1203 EnableWindow $1 1 ;added on dec 04,2007 GetDlgItem $1 $HWND 1202 EnableWindow $1 0 GetDlgItem $1 $HWND 1201 SetCtlColors $1 0xFFFFFF 191970 ;MessageBox MB_OK|MB_ICONINFORMATION "Go to next page" ; call InstallAllFiles Abort UnselectAll: GetDlgItem $0 $HWND 1201 SetCtlColors $0 "transparent" GetDlgItem $1 $HWNDPARENT 1 EnableWindow $1 0 ;MessageBox MB_OK|MB_ICONINFORMATION "Unselect All" StrCpy $isSelectAll "0" GetDlgItem $1 $HWND 1203 EnableWindow $1 0 ;added on dec 04,2007 GetDlgItem $1 $HWND 1202 EnableWindow $1 1 Abort - i want to set back color on clicking SelectAll button and on Clicking UnSelectAll i want the background to be transparent.Please reply me its urgent |
hey thanks a lot its working fine....
|
Its urgent - FOR YOU.
I recommend you using nsDialogs instead of InstallOptions. |
| All times are GMT. The time now is 05:14. |
Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.