PlanetSquires Forums

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: WinFBE 2.1.9 - MessageBox  (Read 146 times)

SeaVipe

  • Senior Member
  • ***
  • Posts: 397
  • Windows 10
WinFBE 2.1.9 - MessageBox
« on: March 28, 2021, 04:20:20 PM »

Hi Paul, in 2.1.9 I've had to add MB_APPLMODAL to MessageBox to make the box modal in a child dialog (not a parent dialog). Otherwise, the ALT key must be tapped to display the MessageBox. This is different behaviour from previous releases of WinFBE. With MB_APPLMODAL added, MessageBox works as expected when called from a child dialog.
« Last Edit: March 28, 2021, 08:11:53 PM by SeaVipe »
Logged
Clive Richey
You're Either Part Of The Solution, Or You're The Problem.
#StaySafe, Always  Keep A Safe #SocialDistance, #WashYourHands Often and please, #StayHome!

Paul Squires

  • Administrator
  • Guru Member
  • *****
  • Posts: 9386
  • Windows 10
    • PlanetSquires Software
Re: WinFBE 2.1.9 - MessageBox
« Reply #1 on: March 28, 2021, 07:43:35 PM »

Thanks Clive, I'll have to test that because I am pretty sure that there is nothing that was changed in the WinFormsX library that would affect this. I will generate a test project and see what the you are referring to about the ALT key, etc.
Logged
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

SeaVipe

  • Senior Member
  • ***
  • Posts: 397
  • Windows 10
Re: WinFBE 2.1.9 - (MessageBox) DateTimePicker Control
« Reply #2 on: March 28, 2021, 08:11:11 PM »

Thanks, Paul.
On another note, the DateTimePicker control is unresponsive to user input. A form with the DTP control loses the cursor while the control has focus. However, any keystrokes or UpDown clicks are actually doing what the user is wanting but the changes do not appear on the control. Close the form and reopen it and the result of those user changes is accurate (the underlying code saves the edits to file and applies those values to the DTP control each time the dialog is opened).
This behaviour is inconsistent as occasionally the control will work properly but I haven't been able to determine the sequence of events that causes it.
There are 2 DTP controls on the same form.
« Last Edit: March 28, 2021, 08:13:48 PM by SeaVipe »
Logged
Clive Richey
You're Either Part Of The Solution, Or You're The Problem.
#StaySafe, Always  Keep A Safe #SocialDistance, #WashYourHands Often and please, #StayHome!

Paul Squires

  • Administrator
  • Guru Member
  • *****
  • Posts: 9386
  • Windows 10
    • PlanetSquires Software
Re: WinFBE 2.1.9 - MessageBox
« Reply #3 on: March 30, 2021, 09:56:03 AM »

Hi Paul, in 2.1.9 I've had to add MB_APPLMODAL to MessageBox to make the box modal in a child dialog (not a parent dialog). Otherwise, the ALT key must be tapped to display the MessageBox. This is different behaviour from previous releases of WinFBE. With MB_APPLMODAL added, MessageBox works as expected when called from a child dialog.

Hi Clive, I am trying to troubleshoot your question. How are you calling the MessageBox? Can you show me the function call you are using? Are you passing the window handle of your popup form to the MessageBox so that the MessageBox treats the popup form as its parent?

Code: [Select]
''
''
Function frmPopup_Button1_Click( ByRef sender As wfxButton, ByRef e As EventArgs ) As LRESULT
   MessageBox( sender.hWindow, "My Message", "My Caption", MB_OK )
   Function = 0
End Function

Also, this phrase confuses me "Otherwise, the ALT key must be tapped to display the MessageBox". Why would you have to trap the ALT key?

Logged
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

Paul Squires

  • Administrator
  • Guru Member
  • *****
  • Posts: 9386
  • Windows 10
    • PlanetSquires Software
Re: WinFBE 2.1.9 - MessageBox
« Reply #4 on: March 30, 2021, 09:58:50 AM »

On another note, the DateTimePicker control is unresponsive to user input. A form with the DTP control loses the cursor while the control has focus. However, any keystrokes or UpDown clicks are actually doing what the user is wanting but the changes do not appear on the control. Close the form and reopen it and the result of those user changes is accurate (the underlying code saves the edits to file and applies those values to the DTP control each time the dialog is opened).
This behaviour is inconsistent as occasionally the control will work properly but I haven't been able to determine the sequence of events that causes it.
There are 2 DTP controls on the same form.
My simple test project can not duplicate your experience. Are you doing anything behind the scenes to try to trap keys, filter keys, or manually set focus to controls based on user movements, etc ?
Logged
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

SeaVipe

  • Senior Member
  • ***
  • Posts: 397
  • Windows 10
Re: WinFBE - MessageBox
« Reply #5 on: March 30, 2021, 02:41:51 PM »

Hi Paul, What I just discovered was that the issue is being exacerbated by my use of a second monitor. The problem goes away when the child form is dragged to the same monitor as the parent form.
In my use of the app, the main form is on monitor #2, off to my right. The child/editing form is opened on monitor #1 (default monitor) directly in front of me. And this is where the problem occurs and it only occurs once per session. The second and subsequent times a MessageBox is called it pops up without issue. Close the app then restart the app and try MessageBox again and the issue returns.
I stumbled upon the ALT key when I attempted to ALT/Tab to some other open Window (when the child form is on a different monitor to the parent form while the MessageBox was hidden). Pressing the ALT key showed the MessageBox before I had a chance to press the Tab key.
Here's what I have so far:
Parent on Monitor #1, Child on Monitor #1                         - MessageBox functions normally
Parent on Monitor #1, Child dragged to Monitor #2             - MessageBox functions normally
Parent on Monitor #2, Child on Monitor #1                         - MessageBox hidden. Press the ALT key to show MessageBox
Parent on Monitor #2, Child dragged to Monitor #2             - MessageBox functions normally
Parent dragged to Monitor #2, Child dragged to Monitor #2 - MessageBox hidden. Press the ALT key to show MessageBox


The parent screen position is set in frmMainJ_Load using values from an ini file.
Because of the way Windows handles multiple monitors, I've had to hard code the Child screen position to monitor #1 so the child must be dragged to monitor #2 for the above experiments.
I hope this helps to clarify my PP.
Logged
Clive Richey
You're Either Part Of The Solution, Or You're The Problem.
#StaySafe, Always  Keep A Safe #SocialDistance, #WashYourHands Often and please, #StayHome!