PlanetSquires Forums

Support Forums => PlanetSquires Software => Topic started by: jermy on May 05, 2020, 12:22:57 PM

Title: DateTimePicker
Post by: jermy on May 05, 2020, 12:22:57 PM
Hi Paul,

DateTimePicker does not always completely change to the correct format


''
''
Function frmMain_Button1_Click( ByRef sender As wfxButton, ByRef e As EventArgs ) As LRESULT

frmMain.DateTimePicker1.DateFormat = DateTimePickerFormat.TimeFormat   'does not completely change to the correct format

   Function = 0
End Function

''
''
Function frmMain_Initialize( ByRef sender As wfxForm, ByRef e As EventArgs ) As LRESULT

   With frmMain.DateTimePicker1
       ''   .DateFormat = DateTimePickerFormat.TimeFormat  'changes completely to the correct format
          .Enabled = False
          .SelectedTime = AfxStrRemoveAnyI(TIME, ":") 
   end with

   Function = 0
End Function


it's not a problem, I just noticed.

Title: Re: DateTimePicker
Post by: Paul Squires on May 07, 2020, 09:03:18 AM
Hi jermy, I am not seeing what the problem is, or I am not following what it is you are observing.
You may need to guide me through this one a little more. When I press Button1 the DateTimePicker control seems to correctly stay in the TimeFormat format.
Title: Re: DateTimePicker
Post by: jermy on May 07, 2020, 09:55:16 AM
Hi Paul,

I have added an example, when I click on the button I have a date time picker in time format with a calendar.
This behavior is different when you place the change command in frmMain_Initialize.
Title: Re: DateTimePicker
Post by: Paul Squires on May 07, 2020, 11:50:59 AM
ahhh, okay, now I understand. When changing to TimeFormat obviously we want Updown buttons instead of dropdown calendar. I'll fix that.
Title: Re: DateTimePicker
Post by: jermy on May 07, 2020, 12:04:03 PM
Tnx Paul,

Just experienced, FormWindowState.Maximized and FormWindowState.Normal work the other way around


' frmMain form code file

''
''
Function frmMain_Button1_Click( ByRef sender As wfxButton, ByRef e As EventArgs ) As LRESULT

    frmMain.WindowState = FormWindowState.Maximized  'frmMain goes to normal state

   Function = 0
End Function

''
''
Function frmMain_Button2_Click( ByRef sender As wfxButton, ByRef e As EventArgs ) As LRESULT

    frmMain.WindowState = FormWindowState.Normal  'frmMain goes to maximized state

   Function = 0
End Function

''
''
Function frmMain_Initialize( ByRef sender As wfxForm, ByRef e As EventArgs ) As LRESULT

    frmMain.Button1.Text = "Maximized"
    frmMain.Button2.Text = "Normal"
   
   Function = 0
End Function
'FormWindowState.Minimized works as expected



Title: Re: DateTimePicker
Post by: Paul Squires on May 07, 2020, 12:37:00 PM
Thanks - that was a small typo. Got it fixed now.