Jump to content
Sign in to follow this  
Barfly

Reset the date from a .ini file

Recommended Posts

:"> I am feeling a little stupid at the moment as I cannot find a resolution to this problem. I have read through previous entries on this site and can not make head nor tail of them.

The problem is that I have a GUIctrlDate on my GUI, I would like the user to be able to select a date, which is then written to an .ini file. Then, each time the GUI is opened, I want to read said date from the .ini file and reset the date accordingly.

Please understand that I am fairly new at this.

Here is what I have so far:

GUICreate("My GUI", 200, 200, -1, 50)
$Date = GUICtrlCreateDate(String($DateSet), 230, 10, 150, 23, $DTS_SHOWNONE+$DTS_Shortdateformat)
$DateSet = IniRead(@ProgramsCommonDir & "\Test\Report.ini", "Main Menu", "Date", "")

Can anyone out there help me? :(

Share this post


Link to post
Share on other sites

Hope this helps:

#include <GuiConstants.au3>

Dim $Date
Dim $DateSet

GUICreate("My GUI", 200, 200, -1, 50)
$DateSet = IniRead("C:\Report.ini", "Main Menu", "Date", ""); The date in the INI must be written like 2005/01/01 !!!
$Date = GUICtrlCreateDate($DateSet, 10, 10, 150, 23, $DTS_SHOWNONE+$DTS_Shortdateformat)

GuiSetState()
While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case Else
    ;;;
    EndSelect
WEnd
Exit

Going home now for the weekend!!

Good luck.

PS; I altered the your destinations a bit for testing on my PC !!!

Also you placed your $date outside of the GUI !!

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...