Scripter2004
(Fresh Scripter)
2004-03-08 04:44 PM
KiXforms: giving main form focus after message box

I'm using KiXforms to display a form. After a user clicks a button, a message box is displayed. The problem is that after the message box is closed, the form window is no longer the active window. I've tried to work with the SetFocus function, but I can't get it to work. It's not the end of the world, but it's very annoying.

Thx
Ron


ShawnAdministrator
(KiX Supporter)
2004-03-08 04:54 PM
Re: KiXforms: giving main form focus after message box

Are you using the Kixforms MessageBox or the Kixtart MesasgeBox ?

-Shawn


Scripter2004
(Fresh Scripter)
2004-03-08 04:55 PM
Re: KiXforms: giving main form focus after message box

KiXtart

ShawnAdministrator
(KiX Supporter)
2004-03-08 05:08 PM
Re: KiXforms: giving main form focus after message box

The Kixtart MessageBox and the Kixforms MessageBox do not live too well together ... Kixforms knows nothing about Kixtart MessageBoxes and visa versa - when the MessageBox is dismissed, Kixtart sets focus back to the only windows it really knows about ... the Console window.

Would suggest trying the Kixforms MessageBox instead ... there are a couple of variations of these depending on the KF version ... the pure dotnet box looks like this:

Code:

$System = CreateObject("Kixtart.System")

$ = $System.MessageBox.Show(
"Message Text",
"Title",
$System.MessageBoxButtons.YesNo,
$System.MessageBoxIcon.Information,
$System.MessageBoxDefaultButton.Button2 )



Another depracated usage is:

Code:

$ = $Form.MessageBox("Message Text","Title",0)



Where 0 (zero) is the style just like in Kixtart.

-Shawn


Scripter2004
(Fresh Scripter)
2004-03-08 05:50 PM
Re: KiXforms: giving main form focus after message box

Using the KiXforms MessageBox function did the trick.
Thanks!


Schuliebug
(Hey THIS is FUN)
2004-03-15 10:41 AM
Re: KiXforms: giving main form focus after message

I haven't played with the KiXforms Messagebox yet, but what about a timeout value ??

Chris S.
(MM club member)
2004-03-15 02:12 PM
Re: KiXforms: giving main form focus after message

The MessageBox object accepts the Style properties that are standard with the Windows API, which doesn't include a timeout.

If your question is actually a suggestion, you should really post this on the KiXforms forum.


Schuliebug
(Hey THIS is FUN)
2004-03-15 04:36 PM
Re: KiXforms: giving main form focus after message

Thankz, i will do that. However, i thought shawn mentioned a wile ago that he would omplement a timeout in the KiXforms messagebox as it is in the KiXtart messagebox.

Glenn BarnasAdministrator
(KiX Supporter)
2004-03-15 06:08 PM
Re: KiXforms: giving main form focus after message

What about coding an "OnTimer" event to hide the message box? I use that to pop up status messages on the main form - it could probably be used the same way to issue a msgbox.close statement.

Glenn


Sealeopard
(KiX Master)
2004-03-15 07:49 PM
Re: KiXforms: giving main form focus after message

Or write your own custom message box function that includes a timer.