Jump to content

UniDateTimePicker Anomaly, Mouse or Keyboard?


jemmyhatta

Recommended Posts

Hi,

Below is the code of my little program, part of the bigger one. Sorry if I have to ask, this matter really made me confused for long.

Please check the "JamKunjungan" field. supposedly, the field is automatically filled by the real time (from the computer's clock). Or, at least, user can input that field manualy and they can save it seamlessly. But, it really funny, the "JamKunjungan" field, UniDateTimePicker, can changed randomly and not running as what I want.

What I want:
-) When the form is active for the first time, the field is automatically filled by the real time, not selected from the list.
-) When the user input the time manually, click enter, and saving the records by click the button, the "JamKunjungan" field is sent to 

    database as is, whatever inputted by the user, and not selected from the list.
-) The program works in this idea in mind: user changed whatever they want to change, finished, and then they update the database.

What I found:
+) When I try to change the tme manually, and then press enter, or using keyboard to change the cell selected, the "JamKunjungan"

    field is changed (filled by one of the list, rewritten whatever I typed before).

+) When I use MOUSE to click elsewhere after I changed the "JamKunjungan" field manually, whatever I typed is saved as is and not

    change by one from the list.

Why? Is it how the UniDateTimePicker works? I have to use mouse, and keyboard not supported? Is it a limitation? or bug? or my code have any flaw maybe? Please enlightened me, Thanks.

You can try to run that program first. Click any "jamKunjungan" field, enter some time, press enter, and so on. You can try to changed another row too, and checked the anomaly there. I'm really confused what and where is my mistake there. Please help me, thanks.



 

Project6.zip

Link to comment
Share on other sites

  • Administrators

Problem here is DisplayFormat of the field. You have set it to hh:mm. It must be hh:nn.

m  The month as a number without a leading zero (1-12). If the m specifier immediately follows an h or hh specifier, the minute rather than the month is displayed. 
mm  The month as a number with a leading zero (01-12). If the mm specifier immediately follows an h or hh specifier, the minute rather than the month is displayed. 
mmm  The month as an abbreviation (Jan-Dec) using the strings given by the ShortMonthNames global variable. 
mmmm  The month as a full name (January-December) using the strings given by the LongMonthNames global variable. 
yy  The year as a two-digit number (00-99). 
yyyy  The year as a four-digit number (0000-9999). 
h  The hour without a leading zero (0-23). 
hh  The hour with a leading zero (00-23). 
n  The minute without a leading zero (0-59). 
nn  The minute with a leading zero (00-59).
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...