InfoBox and focus on the form


Author
Message
Fabian R Silva, -
Fabian R Silva, -
StrataFrame User (317 reputation)StrataFrame User (317 reputation)StrataFrame User (317 reputation)StrataFrame User (317 reputation)StrataFrame User (317 reputation)StrataFrame User (317 reputation)StrataFrame User (317 reputation)StrataFrame User (317 reputation)StrataFrame User (317 reputation)
Group: StrataFrame Users
Posts: 153, Visits: 1.2K
I like to display a InfoBox, but I want to keep the focus on the active control. How I can do that? I don't find a property on the infobox that says "getFocus" or something else, thanks Smile
Replies
Fabian R Silva, -
Fabian R Silva, -
StrataFrame User (317 reputation)StrataFrame User (317 reputation)StrataFrame User (317 reputation)StrataFrame User (317 reputation)StrataFrame User (317 reputation)StrataFrame User (317 reputation)StrataFrame User (317 reputation)StrataFrame User (317 reputation)StrataFrame User (317 reputation)
Group: StrataFrame Users
Posts: 153, Visits: 1.2K
Thanks for the reply

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 Smile

StrataFrame Team
S
StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
Well, I'm sorry, but I'm all out of ideas on trying to get the form to re-activate. 
Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
Fabian,

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 Code
MyTimer.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()

Fabian R Silva, -
Fabian R Silva, -
StrataFrame User (317 reputation)StrataFrame User (317 reputation)StrataFrame User (317 reputation)StrataFrame User (317 reputation)StrataFrame User (317 reputation)StrataFrame User (317 reputation)StrataFrame User (317 reputation)StrataFrame User (317 reputation)StrataFrame User (317 reputation)
Group: StrataFrame Users
Posts: 153, Visits: 1.2K
Thanks!!! It worked ok you got the solution, I not suppose that a timer can change the things, but you clarify me it. BigGrin

Dim InfoboxTimer As New Timer()
InfoboxTimer.Interval = 50 'the min value that work ok for me...
AddHandler InfoboxTimer.Tick, AddressOf InfoboxTimer_Tick
InfoboxTimer.Enabled = True
MicroFour.StrataFrame.Messaging.InfoBox.DefaultTimeOut = 1000
MicroFour.StrataFrame.Messaging.InfoBox.NotifyBox("Title","description")

'Timer_Tick  handler
Private 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


Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
Good.  I am glad that worked for you.  At some point all developers have the "Window Handle Blues." Hehe
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
Fabian R Silva, - - 18 Years Ago
Peter Jones - 18 Years Ago
Fabian R Silva, - - 18 Years Ago
Peter Jones - 18 Years Ago
Fabian R Silva, - - 18 Years Ago
Trent L. Taylor - 18 Years Ago
                     Thanks for reply.

[codesnippet]Dim HWmdActiveWindow As...
Fabian R Silva, - - 18 Years Ago
                         You might try this from within the form: InfoBox.NofityBox(...)...
StrataFrame Team - 18 Years Ago
                             Thanks for the reply I try with you suggestions (Activate,...
Fabian R Silva, - - 18 Years Ago
                                 Well, I'm sorry, but I'm all out of ideas on trying to get the form to...
StrataFrame Team - 18 Years Ago
                                     Fabian, Try this just to see if it works. Use a timer to re-execute...
Trent L. Taylor - 18 Years Ago
                                         Thanks!!!It worked ok you got the solution, I not suppose that a timer...
Fabian R Silva, - - 18 Years Ago
                                             Good. I am glad that worked for you. At some point all developers have...
Trent L. Taylor - 18 Years Ago

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search