|
-
Apr 18th, 2003, 01:59 AM
#1
Thread Starter
Frenzied Member
Detect Escape from OkOnly MsgBoxes - Resolved by using Custom Forms as MsgBoxes
VB Code:
Private Sub Command1_Click()
MsgBox MsgBox("Sorry! No choices for this!", vbOKOnly, "Tough Luck")
End Sub
How can I capture an Escape Key Press for that?
Last edited by KayJay; Apr 18th, 2003 at 06:16 AM.
"Brothers, you asked for it."
...Francisco Domingo Carlos Andres Sebastian D'Anconia
-
Apr 18th, 2003, 03:03 AM
#2
y would you want 2?
it returns the same value 1
if you want you could use vbyesno and have an option for the user.
if you really want to find out if they close the window then you can eather subclass the window or create ur own version of Msgbox
Tips:
- Google is your friend! Search before posting!
- Name your thread appropriately... "I Need Help" doesn't cut it!
- Always post your code!!!! We can't read your mind!!! (well, at least most of us!)
- Allways Include the Name and Line of the Exception (if one is occuring!)
- If it is relevant state the version of Visual Studio/.Net Framwork you are using (2002/2003/2005)
If you think I was helpful, rate my post  IRC Contact: Rizon/xous ChakraNET/xous Freenode/xous
-
Apr 18th, 2003, 03:15 AM
#3
The 'Esc' or 'x' or 'Ok' will all return the same value of 1.
Use the vbYesNoCancel messagebox.
This way if the user clicks on the x or cancels or esc you can detect it
with vbCancel const. equalling 2.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Apr 18th, 2003, 03:31 AM
#4
Thread Starter
Frenzied Member
Subclassing seems overkill. Custom MsgBox is what I plan to use.
Thanx anyways
Cheers
Regards
KayJay
"Brothers, you asked for it."
...Francisco Domingo Carlos Andres Sebastian D'Anconia
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|