Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: VB5,VB6
Expertise: Intermediate
Aug 4, 2001

Determine whether the IDE is in design, break, or run mode

The VBIDE object model doesn't offer any native property or method to determine whether the IDE is in design-time mode, run-time mode, or debug (break) mode. However, it's easy to deduct this information by looking at the Enabled property of the menu commands in the Run top-level menu:

' this code assumes that VBInstance holds a reference
' the the VBE root object

With VBInstance.CommandBars("Run")
    If .Controls("End").Enabled = False Then
        ' we are in design mode
    ElseIf .Controls("Break").Enabled Then
        ' we are in run mode
    Else
        ' we are in break mode
    End if
End With
Note, however, that this code might not work under localized versions of Visual Basic.
Francesco Balena
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date