I know that Ctrl + G shows the debug window.
Is is also possible to close it using the keyboard?
Pradeep
Last edited by Pradeep1210; Nov 26th, 2005 at 01:08 PM.
Pradeep, Microsoft MVP (Visual Basic) Please appreciate posts that have helped you by clicking icon on the left of the post.
"A problem well stated is a problem half solved." — Charles F. Kettering
I was looking for some way to close it using the keyboard.
Pradeep
Pradeep, Microsoft MVP (Visual Basic) Please appreciate posts that have helped you by clicking icon on the left of the post.
"A problem well stated is a problem half solved." — Charles F. Kettering
With what I know it's not possible to do it. I was wondering if someone could help with some addin that could add this capability to VB6 editor.
Pradeep
Pradeep, Microsoft MVP (Visual Basic) Please appreciate posts that have helped you by clicking icon on the left of the post.
"A problem well stated is a problem half solved." — Charles F. Kettering
Forgive my ignorance, why it would be useful? You don't like the mouse? Or maybe the mouse doesn't work? Just curiosity.
Many a times we need to frequently check variable/property values or run some procedure or set some value while debugging thus using the debug window. Ctrl+G comes here handy.
But as soon as that has been done and we want to resume debugging, we need more visible space and we need to close the debug window.
When doing the above thing quite fast, it's a pain in the neck to touch the mouse every now and then.
@brucevde
Alt+F4 closes the entire application, Ctrl+F4 will close the active window in an MDI application.
In VB IDE, it will close the debug window only when it is in window form, i.e. it is NOT docked. I want to close the debug window whether docked or not. (My debug window is usually docked)
@Marty:
When I start a new Addin Program, and run it, it doesn't seem to run. Do we need to do something else also for addin programs. I havn't made any addins yet.
Pradeep
Pradeep, Microsoft MVP (Visual Basic) Please appreciate posts that have helped you by clicking icon on the left of the post.
"A problem well stated is a problem half solved." — Charles F. Kettering
But how do I trap keys?
(say I want to press Ctrl+Shift+G) to close the debug window.
Pradeep
Pradeep, Microsoft MVP (Visual Basic) Please appreciate posts that have helped you by clicking icon on the left of the post.
"A problem well stated is a problem half solved." — Charles F. Kettering
Re: Close Debug Window using Keyboard (Addin Project)
Actually what I wanted to know is that how will the Shortcut apply to the IDE? How do I code it within the Addin?
Pradeep
Pradeep, Microsoft MVP (Visual Basic) Please appreciate posts that have helped you by clicking icon on the left of the post.
"A problem well stated is a problem half solved." — Charles F. Kettering
Re: Close Debug Window using Keyboard (Addin Project)
Sorry Pradeep but I'm going to back out on my offer. While I've written a couple of addins (one of which is in the UtilityBank) it's still a lot of work and I guess I'm just not up to it. Let me suggest this book. It's the one I use.
You can use the code in the sample project to figure out how to do hooks (properly).
I recently converted this code to a .DLL which means you could add it to your project as a Class Module (and a few modules) instead of as a user control. If you want to do that let me know and I will upload it. Otherwise just take your lead from that code and hook the "Ctrl+Shift+G" command and respond to it as you wish.
Re: Close Debug Window using Keyboard (Addin Project)
OK After a bit of understanding, I made this addin.
To use it, open the project, and compile the dll. Then close the IDE. After this whenever you open any project, you will find an entry in the "Add-ins" menu called "Hide Immideate Window"
The only problem now is how to Assign Shortcut keys. Please help?
Pradeep
Pradeep, Microsoft MVP (Visual Basic) Please appreciate posts that have helped you by clicking icon on the left of the post.
"A problem well stated is a problem half solved." — Charles F. Kettering
Re: Close Debug Window using Keyboard (Addin Project)
Originally Posted by Pradeep1210
OK After a bit of understanding, I made this addin.
To use it, open the project, and compile the dll. Then close the IDE. After this whenever you open any project, you will find an entry in the "Add-ins" menu called "Hide Immideate Window"
The only problem now is how to Assign Shortcut keys. Please help?
Pradeep
Did you see post #17? That lets you do shortcuts. Its not that hard, but there is not VERY simple way of going about it.
Re: Close Debug Window using Keyboard (Addin Project)
Originally Posted by eyeRmonkey
Did you see post #17? That lets you do shortcuts. Its not that hard, but there is not VERY simple way of going about it.
*sigh* I understand how to use it in regular VB applications but I can't spot the way to use it for Addins.
Pradeep
Pradeep, Microsoft MVP (Visual Basic) Please appreciate posts that have helped you by clicking icon on the left of the post.
"A problem well stated is a problem half solved." — Charles F. Kettering
Re: Close Debug Window using Keyboard (Addin Project)
You can add a menu item to one of the IDE's menus and create a shortcut that way. This is how I added an "Initial Frame Placement" option in the Format menu.
VB Code:
Private Sub IDTExtensibility_OnConnection(ByVal VBInst As Object, ByVal ConnectMode As VBIDE.vbext_ConnectMode, ByVal AddInInst As VBIDE.AddIn, custom() As Variant)
On Error GoTo error_handler
'save the vb instance
Set VBInstance = VBInst
'this is a good place to set a breakpoint and
'test various addin objects, properties and methods
If ConnectMode = vbext_cm_External Then
'Used by the wizard toolbar to start this wizard
m_Place.VBIDE = VBInstance
Else
Set mcbMenuCommandBar = AddToAddInCommandBar("&Initial Frame Placement")
'sink the event
Set Me.MenuHandler = VBInst.Events.CommandBarEvents(mcbMenuCommandBar)
End If
Exit Sub
error_handler:
MsgBox Err.Description
End Sub
Function AddToAddInCommandBar(sCaption As String) As Office.CommandBarControl
Dim cbMenuCommandBar As Office.CommandBarControl 'command bar object
Dim cbMenu As Object
On Error GoTo AddToAddInCommandBarErr
Set cbMenu = VBInstance.CommandBars("Format")
If cbMenu Is Nothing Then
'not available so we fail
Exit Function
End If
'add it to the command bar
Set cbMenuCommandBar = cbMenu.Controls.Add(before:=3)