Archive: How to change backcolor of textbox on custom page


How to change backcolor of textbox on custom page
  Hi Everyone,

I have created a custom page using .ini file, i have textbox and combobox controls in that custom page, I want to change the background color of the textbox, is there any property that we will add in .ini file to change bachcolor of the textbox.Please suggest solution,

Thanks,
Dhiraj


You'd have to try SetCtlColors. I recommend switching from the ini-based InstallOptions to nsDialogs.


I have tried by using SetCtlColors but it will not changing the back color of textbox

Also, I want to increase a height and width of control on Components page,I TRIED IT, BUT I WILL NOT GET ANY SOLUTION FOR IT,

CAN YOU PLEASE SUGGET SOLUTION FOR IT,

TANKS IN ADVANCE

THANKS,
DHIRAJ


Please stop writing in capital letters, it makes you sound like you're shouting.

For information on how to use SetCtlColors, search the forums. The background color question is asked at least once a week.

For information on how to edit the width and height of a control, search the forums.


The below code will set the background color to BLACK and the text Color to White.In a similar way u can change the background and text color..

As MSG said .. just search the forum you will get enough info.



         FindWindow $HWND "#32770" "" $HWNDPARENT

GetDLgItem$0 $HWND 1201
SetCtlColors$0 FFFFFF 000000
>

Sorry, for typing in capital letters, but at the time of writing this Posts i am connected to my pc using logmein, so, i am not able to off my Caps Lock key.


Thanks,
Dhiraj


issue solved??


No, my problem is not solved, actually i want increase height and width of the panel on MUI_COMPONENTS_PAGE, refer the screenshot, in that i want to increase the height and width of that panel which contains the list of components to be installed.
I have checked in file
C:\Program Files\NSIS\Contrib\Modern UI 2\Pages\Components.nsh
But i did not find any parameter which will set the size of that panel,

Also, For changing the textbox color i am using the installoptions, i have created a .ini file in which i have put a textbox, but by default, the backcolor of that textbox is tranferrent.I want to change it to white, ( i want to change the backcolor of that textbox not of the page) for that i tried by following code.

!insertmacro INSTALLOPTIONS_READ $R2 "ClientComponentsList.ini" "Field 1" "HWND"
GetDlgItem $R2 $HWND 1201
SetCtlColors $0 FFFFFF 000000

but, it is not working,

Please suggest the solution,

Thanks,
Dhiraj


1. would be easier solved using reshacker - adjust the UI executable to taste

2. when you read the HWND value from Field 1, it gives you the HWND of the control itself. So you need to skip the GetDlgItem part and use $R2 directly in the SetCtlColors call.


The components page does not use nsDialogs nor InstallOptions. Use FindWindow $R0 `#32770` `` $HWNDPARENT to get the inner dialog followed by GetDlgItem with the correct control ID. Use Resource Hacker to find that ID (or look in NSIS source).

Stu


For custom pages based on .ini files (tahat old ones created with InstallOptions) you should use this code for obtaining HWND to controls:


GetDlgItem $R2 $HWND 1200 ;1200 + Field number - 1


Controls on .ini page have other ID than usual controls - they starts with 1200:
So if your Edit is Field 1 you should use '1200 + 1 - 1'