PlanetSquires Forums

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: DateTimePicker  (Read 249 times)

jermy

  • Little Newbie
  • *
  • Posts: 44
DateTimePicker
« on: May 05, 2020, 11:52:57 AM »

Hi Paul,

DateTimePicker does not always completely change to the correct format

Code: [Select]
''
''
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.

Logged

Paul Squires

  • Administrator
  • Guru Member
  • *****
  • Posts: 9287
  • Windows 10
    • PlanetSquires Software
Re: DateTimePicker
« Reply #1 on: May 07, 2020, 08:33: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.
Logged
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

jermy

  • Little Newbie
  • *
  • Posts: 44
Re: DateTimePicker
« Reply #2 on: May 07, 2020, 09:25: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.
Logged

Paul Squires

  • Administrator
  • Guru Member
  • *****
  • Posts: 9287
  • Windows 10
    • PlanetSquires Software
Re: DateTimePicker
« Reply #3 on: May 07, 2020, 11:20:59 AM »

ahhh, okay, now I understand. When changing to TimeFormat obviously we want Updown buttons instead of dropdown calendar. I'll fix that.
Logged
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

jermy

  • Little Newbie
  • *
  • Posts: 44
Re: DateTimePicker
« Reply #4 on: May 07, 2020, 11:34:03 AM »

Tnx Paul,

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

Code: [Select]
' 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


Logged

Paul Squires

  • Administrator
  • Guru Member
  • *****
  • Posts: 9287
  • Windows 10
    • PlanetSquires Software
Re: DateTimePicker
« Reply #5 on: May 07, 2020, 12:07:00 PM »

Thanks - that was a small typo. Got it fixed now.
Logged
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer