TForm:Show() - how to stay focused...?
Publicado: Vie Jun 24, 2022 4:04 pm
Hi,
In a message-only form(not modal), how to keep focus? prevent clicks on other controls (menus in other windows...). Can something inside the FormShowModal function help me?
I have messageRun( bAction, cMsg ) which works perfectly. Naturally it doesn't use :show() and I have to use {||SomeProcess()}.
regards,
In a message-only form(not modal), how to keep focus? prevent clicks on other controls (menus in other windows...). Can something inside the FormShowModal function help me?
I have messageRun( bAction, cMsg ) which works perfectly. Naturally it doesn't use :show() and I have to use {||SomeProcess()}.
Código: Seleccionar todo
METHOD BtnProcessoClick( oSender ) CLASS TFrmEstoque
// self / this form is modal.
messageStart( 'Atualização de estoque' ) // this form is not modal
Sleep(3*1000)
Process('lendo...') // ProcessMessages()
Sleep(3*1000)
Process('lendo 2...')
Sleep(3*1000)
messageEnd()
return nil
function messageStart( cMsg )
...
// osDlg:OnDeactivate :={|o| o:setFocus()} // SetForegroundWindow // it doesn't help
// osDlg:OnChangeFocus:={|o| o:setFocus()} // it doesn't help
osDlg:show()
return nil