Set Date to Checkbox and uncheck it again
Posted: 26 May 2018, 04:25
Hi everybody! This is my first post, I am a real newbie...
I was able to build a GUI that works fine but I want to improve its usability. In this GUI I have more than 100 "DateTime-Checkboxes" which look like this for example:
Gui Add, DateTime, vU01_CheckIn x155 y50 w100 ChooseNone, dd.MM.yyyy
The Users have to modify a lot of dates in the boxes and my problem is that the selected date in the calendar always stays with the actual date. So if they work on a project with dates in the future they have to click through the calender a pretty long time to select the correct date.
It would be a great help if I could tell those Checkboxes to start with a different day than today. As this differs from project to project I thought of a variable I call #startdate# and I tried to change all checkboxes to this startdate and then uncheck them again (otherwise they would have to uncheck all unnecessary checkboxes manually). This seemed like a simple task that I put into a subroutine like this:
if (U01_CheckIn = "") ; if checkbox is unchecked
{
GuiControl, , U01_CheckIn, %startdate% ; change the date to startdate (this works)
GuiControl, , U01_CheckIn, 0 ; uncheck the checkbox (this does not work)
}
Why is the checkbox still checked? What am I doing wrong?
Thanks in advance for any help!
I was able to build a GUI that works fine but I want to improve its usability. In this GUI I have more than 100 "DateTime-Checkboxes" which look like this for example:
Gui Add, DateTime, vU01_CheckIn x155 y50 w100 ChooseNone, dd.MM.yyyy
The Users have to modify a lot of dates in the boxes and my problem is that the selected date in the calendar always stays with the actual date. So if they work on a project with dates in the future they have to click through the calender a pretty long time to select the correct date.
It would be a great help if I could tell those Checkboxes to start with a different day than today. As this differs from project to project I thought of a variable I call #startdate# and I tried to change all checkboxes to this startdate and then uncheck them again (otherwise they would have to uncheck all unnecessary checkboxes manually). This seemed like a simple task that I put into a subroutine like this:
if (U01_CheckIn = "") ; if checkbox is unchecked
{
GuiControl, , U01_CheckIn, %startdate% ; change the date to startdate (this works)
GuiControl, , U01_CheckIn, 0 ; uncheck the checkbox (this does not work)
}
Why is the checkbox still checked? What am I doing wrong?
Thanks in advance for any help!