|
GUI
Apr 13, 2018 12:17:42 GMT -5
Post by bmroyer on Apr 13, 2018 12:17:42 GMT -5
I am making a Lawn Care Business suit program and want the main part of the program (Main Window) to show the date and the time at the top of the window.What GUI control would i need to use to do this?
|
|
|
GUI
Apr 13, 2018 12:21:35 GMT -5
Post by bmroyer on Apr 13, 2018 12:21:35 GMT -5
I attached a picture of what I am talking about because I am sure I did not make sense. Attachments:
|
|
|
GUI
Apr 13, 2018 12:35:19 GMT -5
Post by Alyce Watson on Apr 13, 2018 12:35:19 GMT -5
You can easily retrieve the date in the format of your choice and display it on a statictext control. If you need help with that, or code, let us know.
|
|
|
GUI
Apr 13, 2018 12:41:54 GMT -5
Post by Chris Iverson on Apr 13, 2018 12:41:54 GMT -5
I personally would just use a statictext, and update it as needed. You can use a command to update the text shown in the statictext.
Manual string manipulation/formatting would need to be done beyond this, but this shows the basic idea.
'Form created with the help of Freeform 3 v07-15-08 'Generated on Apr 13, 2018 at 12:40:12
[setup.main.Window]
'-----Begin code for #main
nomainwin WindowWidth = 295 WindowHeight = 200 UpperLeftX=int((DisplayWidth-WindowWidth)/2) UpperLeftY=int((DisplayHeight-WindowHeight)/2)
'-----Begin GUI objects code
statictext #main.timestamp, "DATE/TIME", 5, 5, 200, 20 button #main.button2,"Update",[button2Click], UL, 95, 67, 55, 25
'-----End GUI objects code
open "untitled" for window as #main print #main, "font ms_sans_serif 10" print #main, "trapclose [quit.main]"
[main.inputLoop] 'wait here for input event wait
[button2Click] 'Perform action for the button named 'button2'
'Insert your own code here
str$ = date$() + " " + time$()
#main.timestamp, str$
wait
[quit.main] 'End the program close #main end
Also, shout-out to a fellow D2 fan.
|
|
|
Post by bmroyer on Apr 14, 2018 15:07:33 GMT -5
Thanks I will try it out when I get some time. Nice to see fellow Diablo 2 players. US East is still very active on Battle.net.
|
|
|
Post by Mark Dunham on Apr 14, 2018 16:03:34 GMT -5
Thanks I will try it out when I get some time. Nice to see fellow Diablo 2 players. US East is still very active on Battle.net. I am still playing Diablo II as well
|
|
|
GUI
Apr 15, 2018 8:21:17 GMT -5
Post by bmroyer on Apr 15, 2018 8:21:17 GMT -5
*bvr US East.
|
|