I try with you suggestions (Activate, SetActiveWindow, Focus, DoEvent) but I cannot make the form got focus while the infobox is showing (except with a mouse click on the form)...
If I can't make it work, I will edit the infobox source to accept a parameter with the calling form to see if I can call form.activate() or form.focus() from there and see if it get the order
Thanks for the support, I known I'm try to make the stuff from another way that the framework works and it give me troubles, but I have to make the try because my boss have his needs to adapt from his FoxPro DOS App. and I are the only programmer and I convinced him to use .NET & SF
Try this just to see if it works. Use a timer to re-execute the activation of the form. The problem could be that all of this is trying to execute on the same thread and so the re-activation never takes place. Also, this is not an issue with SF, it has 100% to do with the way WinForms works.
InfoBox()'-- You can reduce this to a smaller interval, but starting with 1 second will give you a good visual when it executes.MyTimer.Interval = 1000 MyTimer.Enabled = True
Timer CodeMyTimer.Enabled = False'-- You might try just forcing the focus back to the control itself first. You could then try' All of the other options previously mentioned in this thread if it doesn't work.MyControlToFocus.Focus()
Dim InfoboxTimer As New Timer()InfoboxTimer.Interval = 50 'the min value that work ok for me...AddHandler InfoboxTimer.Tick, AddressOf InfoboxTimer_TickInfoboxTimer.Enabled = TrueMicroFour.StrataFrame.Messaging.InfoBox.DefaultTimeOut = 1000MicroFour.StrataFrame.Messaging.InfoBox.NotifyBox("Title","description")
'Timer_Tick handlerPrivate Sub InfoboxTimer_Tick(ByVal sender As Object, ByVal e As EventArgs) Dim Tmr As Timer = CType(sender, Timer) Tmr.Enabled = False Me.ParentForm.Activate() 'I coding on a user control... activate his form 'Me.txtCodigo.Focus()End Sub