[Snippet] Autoclose Msgbox - Printable Version +- Support Forums (https://www.supportforums.net) +-- Forum: Categories (https://www.supportforums.net/forumdisplay.php?fid=87) +--- Forum: Coding Support Forums (https://www.supportforums.net/forumdisplay.php?fid=18) +---- Forum: Visual Basic and the .NET Framework (https://www.supportforums.net/forumdisplay.php?fid=19) +---- Thread: [Snippet] Autoclose Msgbox (/showthread.php?tid=18836) |
[Snippet] Autoclose Msgbox - euverve - 05-18-2011 I have derived this code from this post. Code: http://www.vbforums.com/showpost.php?p=3745046&postcount=5 And created a simple function for autoclosing msgbox. Usage: Code: msgboxautoclose("Sample message goes here", MsgBoxStyle.Information, "Title Message", 20) 20 is the delay to close the msgbox Code: Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, Credits goes to paul and modification from me. RE: [Snippet] Autoclose Msgbox - KoBE - 05-18-2011 Thanks for sharing. Not sure why would use this but it seems to work as stated. To make this simpler, I'm sure you could use SendKeys(). RE: [Snippet] Autoclose Msgbox - PURP - 05-18-2011 I am sure I can find this useful somehow thanks for this. RE: [Snippet] Autoclose Msgbox - euverve - 05-19-2011 (05-18-2011, 01:02 PM)KoBE Wrote: Thanks for sharing. Not sure why would use this but it seems to work as stated. To make this simpler, I'm sure you could use SendKeys(). Sendkeys is not working if the msgbox is not on focus. RE: [Snippet] Autoclose Msgbox - KoBE - 05-19-2011 This wouldn't either without Code: AppActivate(Me.Text) so put that in and SendKeys should work. RE: [Snippet] Autoclose Msgbox - stephen5565 - 05-20-2011 I think this had been posted before, I saw this when I clicked the Search Button RE: [Snippet] Autoclose Msgbox - euverve - 05-20-2011 (05-20-2011, 06:42 AM)stephen5565 Wrote: I think this had been posted before, I saw this when I clicked the Search Button I guess we are of different approach. RE: [Snippet] Autoclose Msgbox - Pyratepig - 05-25-2011 Thanks, I was looking for this.~ Was too lazy to search Google :] |